Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WorkerExtensions.csproj to net8 #2973

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/Sdk/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ internal static class Constants

// NetFramework
internal const string NetCoreApp31 = "netcoreapp3.1";
internal const string Net60 = "net6.0";
internal const string Net80 = "net8.0";
internal const string NetCoreApp = ".NETCoreApp";
internal const string NetCoreVersion6 = "v6.0";
internal const string NetCoreVersion31 = "v3.1";
internal const string NetCoreVersion8 = "v8.0";
internal const string AzureFunctionsVersion3 = "v3";

// Binding directions
Expand Down
2 changes: 1 addition & 1 deletion sdk/Sdk/ExtensionsCsprojGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Generate()
internal string GetCsProjContent()
{
string extensionReferences = GetExtensionReferences();
string targetFramework = Constants.Net60;
string targetFramework = Constants.Net80;

if (_targetFrameworkIdentifier.Equals(Constants.NetCoreApp, StringComparison.OrdinalIgnoreCase))
{
Expand Down
1 change: 1 addition & 0 deletions sdk/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Addresses issue with setting `OutDir` msbuild property failing build (PR #2763, Issue #2125)
- Adds support for externally supplied worker extensions project. (PR #2763, Issues #1252, #1888)
- This mode is opt-in only. Using it eliminates the inner-build. This is useful for scenarios where performing a restore inside of build was problematic.
- Updates the generated extension csproj to be net8.0 (from net6.0)

### Microsoft.Azure.Functions.Worker.Sdk.Generators 1.3.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static ExtensionsCsprojGenerator GetGenerator(FuncVersion version, string output
return version switch
{
FuncVersion.V3 => new ExtensionsCsprojGenerator(extensions, outputPath, "v3", Constants.NetCoreApp, Constants.NetCoreVersion31),
FuncVersion.V4 => new ExtensionsCsprojGenerator(extensions, outputPath, "v4", Constants.NetCoreApp, Constants.NetCoreVersion6),
FuncVersion.V4 => new ExtensionsCsprojGenerator(extensions, outputPath, "v4", Constants.NetCoreApp, Constants.NetCoreVersion8),
_ => throw new ArgumentOutOfRangeException(nameof(version)),
};
}
Expand Down Expand Up @@ -244,7 +244,7 @@ private static string ExpectedCsProjV4()
return @"
<Project Sdk=""Microsoft.NET.Sdk"">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Microsoft.Azure.Functions.Worker.Extensions</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
Expand All @@ -259,7 +259,7 @@ private static string ExpectedCsProjV4()

<Target Name=""_VerifyTargetFramework"" BeforeTargets=""Build"">
<!-- It is possible to override our TFM via global properties. This can lead to successful builds, but runtime errors due to incompatible dependencies being brought in. -->
<Error Condition=""'$(TargetFramework)' != 'net6.0'"" Text=""The target framework '$(TargetFramework)' must be 'net6.0'. Verify if target framework has been overridden by a global property."" />
<Error Condition=""'$(TargetFramework)' != 'net8.0'"" Text=""The target framework '$(TargetFramework)' must be 'net8.0'. Verify if target framework has been overridden by a global property."" />
</Target>
</Project>
";
Expand Down