-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update the sdk target to net11.0 #52157
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the SDK's target framework from net10.0 to net11.0 throughout the repository. Despite the PR title saying "Update the sdk target to net10.0", the changes actually update FROM net10.0 TO net11.0, aligning with the next .NET version. The PR includes updates to build infrastructure, test projects, MSBuild targets, and supporting code changes to leverage net11.0 features.
Key changes include:
- Updating the SDK version in global.json to 11.0.100-alpha.1.25614.102
- Updating SdkTargetFramework and NetCurrent properties to net11.0 in Directory.Build.props
- Adding net11.0 to supported target frameworks and updating test data structures
- Code improvements leveraging newer .NET APIs (StringBuilder.Append with repeat count, partial class for EventSource)
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| global.json | Updates dotnet tool version from 10.0.100-rc.1 to 11.0.100-alpha.1 |
| Directory.Build.props | Updates SdkTargetFramework and NetCurrent from net10.0 to net11.0, removes obsolete TODO comment |
| eng/restore-toolset.sh | Adds installation of .NET 10.0.0 shared framework for backward compatibility testing |
| eng/restore-toolset.ps1 | Adds installation of .NET 10.0.0 shared framework for backward compatibility testing |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetFrameworks.props | Adds net11.0 to the list of supported .NET Core App target frameworks |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets | Updates MicrosoftNETBuildTasksTFM from net10.0 to net11.0 |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ApiCompat.targets | Updates ApiCompat task assembly path from net10.0 to net11.0 |
| src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets | Updates build extensions task assembly path from net10.0 to net11.0 |
| src/WebSdk/Publish/Targets/Microsoft.NET.Sdk.Publish.targets | Updates PublishTaskFramework from net10.0 to net11.0 |
| src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets | Updates Razor SDK tasks TFM from net10.0 to net11.0 |
| src/StaticWebAssetsSdk/Targets/Sdk.StaticWebAssets.CurrentVersion.targets | Updates StaticWebAssets SDK tasks and tool TFMs from net10.0 to net11.0 |
| src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets | Updates Blazor WASM SDK tasks and tool TFMs from net10.0 to net11.0 |
| src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets | Updates Blazor WASM SDK tasks and tool TFMs from net10.0 to net11.0 |
| src/Layout/redist/targets/Crossgen.targets | Updates DefaultToolTfm from net10.0 to net11.0 |
| src/Containers/packaging/build/Microsoft.NET.Build.Containers.props | Updates ContainerTaskFramework from net10.0 to net11.0 |
| src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net11.0/PublicAPI.Shipped.txt | Adds new PublicAPI.Shipped.txt file for net11.0 TFM tracking |
| src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net11.0/PublicAPI.Unshipped.txt | Adds comprehensive public API surface for net11.0 Containers SDK (348 APIs) |
| src/StaticWebAssetsSdk/benchmarks/Microsoft.NET.Sdk.StaticWebAssets.Benchmarks.csproj | Updates TargetFrameworks from net10.0 to net11.0 |
| src/Cli/Microsoft.TemplateEngine.Cli/TabularOutput/TabularOutput.cs | Refactors to use StringBuilder.Append(char, count) instead of new string(char, count) for performance |
| src/BuiltInTools/Watch/HotReload/HotReloadEventSource.cs | Adds partial modifier to HotReloadEventSource class for source generator compatibility |
| test/TestAssets/TestProjects/UseCswinrt/consolecswinrt.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/TestAssets/TestProjects/SolutionWithAppAndDcProj/SampleApp/SampleApp.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/TestAssets/TestProjects/MSBuildCultureResourceGeneration/MSBuildCultureResourceGeneration.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/TestAssets/TestPackages/PackageLibraryTransitiveDependency/PackageLibraryTransitiveDependency.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/TestAssets/TestPackages/PackageLibraryNoStaticAssets/PackageLibraryNoStaticAssets.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/TestAssets/TestPackages/PackageLibraryDirectDependency/PackageLibraryTransitiveDependency/PackageLibraryTransitiveDependency.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/TestAssets/TestPackages/PackageLibraryDirectDependency/PackageLibraryDirectDependency/PackageLibraryDirectDependency.csproj | Updates TargetFramework from net10.0 to net11.0 |
| test/Microsoft.NET.Sdk.Web.Tests/PublishTests.cs | Updates conditional compilation from NET10_0 to NET11_0 |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsCrossTargetingTests.cs | Updates test to publish with net11.0 instead of net10.0 |
| test/Microsoft.NET.Publish.Tests/PublishTestUtils.cs | Updates conditional compilation to NET11_0 and adds net10.0 to all test TFM lists |
| test/Microsoft.NET.Publish.Tests/GivenThatWeWantToTestAMultitargetedSolutionWithPublishReleaseOrPackRelease.cs | Adds net11.0 to multi-targeting test and updates expected TFM to net11.0 |
| test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs | Updates unsupported TFM test from netcoreapp10.1 to netcoreapp11.1 |
| test/EndToEnd.Tests/Utilities/SupportedNetCoreAppVersions.cs | Adds "11.0" to the list of supported .NET Core App versions |
| test/EndToEnd.Tests/GivenFrameworkDependentApps.cs | Adds "11.0" to skip conditions for roll-forward tests |
a32e051 to
35e15c8
Compare
eng/restore-toolset.ps1
Outdated
| InstallDotNetSharedFramework "7.0.0" | ||
| InstallDotNetSharedFramework "8.0.0" | ||
| InstallDotNetSharedFramework "9.0.0" | ||
| InstallDotNetSharedFramework "10.0.0-rtm.25523.111" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be just 10.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also failing the test step I think as it appears to be failing in InstallDotNetSharedFramework because 10.0.0 is already installed (and lastexitcode doesn't get set). Seems like it doesn't actually set the last exit code if it skips the install and that breaks the script
The install-scripts won't always set last exit code like if the runtime is already installed so pre-set it.
…on't have an 11 runtime yet. There's not a good central place to set this as different tests use different DBPs so try setting this in the run tests script
| <!-- Paths to tools, tasks, and extensions are calculated relative to the BlazorWebAssemblySdkDirectoryRoot. This can be modified to test a local build. --> | ||
| <BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</BlazorWebAssemblySdkDirectoryRoot> | ||
| <_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net11.0</_BlazorWebAssemblySdkTasksTFM> | ||
| <_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(SdkTargetFramework)</_BlazorWebAssemblySdkTasksTFM> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcpopMSFT this is a shipping file in the SDK and can't use this repo's infrastructure:
C:\Program Files\dotnet\sdk\10.0.100\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could avoid these hardcodes in the future if SDK would expose a latest TargetFramework property. I think there's a tracking issue for that somewhere here in this repo, cc @baronfel
No description provided.