Skip to content

Commit c4b3d81

Browse files
ViktorHoferlewingjtschusterakoeplingerilonatommy
authored
Target .NET 10 / net10.0 (#106599)
* Update dotnet10 feeds * Update hardcoded old TFM values * More hardcode updates and TFM checks * Updates and delete duplicate file in Bcl.Numerics * Linker stays on net9.0 * Fix .NET SDK max supported version * Update apicompat sfx apicompat baseline file * Update Microsoft.NET.WebAssembly.Threading APICompat settings * Fix DiagnosticSource build * Update SDK to RC1 for needed GetAlternateLookup API to be able to build System.Text.Json on net9.0. * Fix APICompat runtime regex pattern * Suppress Bcl.Memory compatibility error for dropped framework * Fix BinaryFormatter tests regex pattern for version subsitution * Update BinaryFormatterTests.cs * Pin SdkVersionForWorkloadTesting to the version in global.json * Treat net9 and net10 as current for now * Bump MicrosoftDotNetILCompilerVersion * Update BinaryFormatterTests.cs * Update System.Resources.Extensions * Update AutoImports as well * Fix ImporterTests.cs * Block failing SignalRClientTests * Update XmlSerialzation Schema Import tests. * Update Versions.props * Update CompatibilitySuppressions.xml for System.Numerics.Tensors * Don't set EnableDefaultCompileItems, it doesn't work since we set EnableDefaultItems=false higher up * Update regex in legacy BinaryFormatterTests.cs too * Hardcode BinaryFormatter test assembly version to 9.0 This allows us to not change the majority of the tests * Fix typo * Fix issue in Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest.pkgproj * Replace ForceNet8Current in a few more places * Fix wasi workload * Fix TreatAsCurrent for 10.0 * Add net9 workload manifests * Update PackageId in icrosoft.NET.Runtime.WebAssembly.Templates.csproj * Update ApiCompatBaseline.NetCoreAppLatestStable.xml Changes from #107758 * Remove duplicate dotnet10 feeds from nuget.config * Update Versions.props * Fake SDK band version for now * Update Versions.props * Update the SDK band versions for real * Update the dotnet/sdk dependencies * Update emsdk to net10 workloads * Install a 9.0 runtime for workload tests too * Update the compat tasks * Merge in changes from net10-manifests * Tmp: Trying out @am11's branch. * Tmp2: Trying out @am11's branch. * Tmp3: Replace the last usage of main in clone action. * Update eng/pipelines/coreclr/templates/build-perf-bdn-app.yml Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> * Update eng/pipelines/coreclr/templates/perf-job.yml Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> * Update eng/pipelines/runtime-wasm-perf.yml Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --------- Co-authored-by: Larry Ewing <lewing@microsoft.com> Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com> Co-authored-by: Ilona Tomkowicz <itomkowicz@microsoft.com> Co-authored-by: Steve Molloy <smolloy@microsoft.com> Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
1 parent 3227d4a commit c4b3d81

File tree

91 files changed

+1226
-3070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1226
-3070
lines changed

Directory.Build.props

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project>
2+
23
<PropertyGroup>
34
<!-- For non-SDK projects that import this file and then import Microsoft.Common.props,
45
tell Microsoft.Common.props not to import Directory.Build.props again. -->
@@ -86,18 +87,16 @@
8687

8788
<!-- The TFMs to build and test against. -->
8889
<PropertyGroup>
89-
<NetCoreAppCurrentVersion>9.0</NetCoreAppCurrentVersion>
90+
<NetCoreAppCurrentVersion>10.0</NetCoreAppCurrentVersion>
9091
<NetCoreAppCurrentIdentifier>.NETCoreApp</NetCoreAppCurrentIdentifier>
9192
<NetCoreAppCurrentTargetFrameworkMoniker>$(NetCoreAppCurrentIdentifier),Version=v$(NetCoreAppCurrentVersion)</NetCoreAppCurrentTargetFrameworkMoniker>
9293
<MicrosoftNetCoreAppFrameworkName>Microsoft.NETCore.App</MicrosoftNetCoreAppFrameworkName>
9394
<NetCoreAppCurrentBrandName>.NET $(NetCoreAppCurrentVersion)</NetCoreAppCurrentBrandName>
9495
<NetCoreAppCurrent>net$(NetCoreAppCurrentVersion)</NetCoreAppCurrent>
9596

9697
<!-- The previous supported .NET version. -->
97-
<NetCoreAppPreviousVersion>8.0</NetCoreAppPreviousVersion>
98-
<!-- For the .NET 9 release, set NetCoreAppPrevious to empty as NuGet has issues
99-
with duplicate TFMs (when using both NetCoreAppPrevious and NetCoreAppMinimum). -->
100-
<NetCoreAppPrevious />
98+
<NetCoreAppPrevious>net9.0</NetCoreAppPrevious>
99+
<NetCoreAppPrevious Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(NetCoreAppCurrent)</NetCoreAppPrevious>
101100

102101
<!-- The minimum supported .NET version. -->
103102
<NetCoreAppMinimum>net8.0</NetCoreAppMinimum>
@@ -122,8 +121,9 @@
122121
<NetFrameworkCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
123122

124123
<!-- Important: Set this to the GA version (or a close approximation) during servicing and adjust the TFM property below. -->
125-
<ApiCompatNetCoreAppBaselineVersion>8.0.0</ApiCompatNetCoreAppBaselineVersion>
126-
<ApiCompatNetCoreAppBaselineTFM>net8.0</ApiCompatNetCoreAppBaselineTFM>
124+
<!-- TODO: Update to 9.0.0 when .NET 9 is generally available. https://github.com/dotnet/runtime/issues/106598 -->
125+
<ApiCompatNetCoreAppBaselineVersion>9.0.0-preview.7.24405.7</ApiCompatNetCoreAppBaselineVersion>
126+
<ApiCompatNetCoreAppBaselineTFM>net9.0</ApiCompatNetCoreAppBaselineTFM>
127127
</PropertyGroup>
128128

129129
<PropertyGroup Label="CalculateConfiguration">

Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
Define this here (not just in Versions.props) because the SDK resets it
4040
unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
4141
-->
42-
<NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
42+
<NETCoreAppMaximumVersion>$(NetCoreAppCurrentVersion)</NETCoreAppMaximumVersion>
4343
<!-- SDK sets product to assembly but we want it to be our product name -->
4444
<Product>Microsoft%AE .NET</Product>
4545
<!-- Use the .NET product branding version for informational version description -->

NuGet.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
1717
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
1818
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
19-
<!-- Required for System.CommandLine SB intermediate -->
2019
<add key="dotnet-libraries-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries-transport/nuget/v3/index.json" />
20+
<!-- TODO: Remove dotnet9 feeds when all dependencies moved to the dotnet10 feeds. https://github.com/dotnet/runtime/issues/106593 -->
2121
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
2222
<add key="dotnet9-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9-transport/nuget/v3/index.json" />
2323
<add key="dotnet10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json" />

docs/coding-guidelines/adding-api-guidelines.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ the implementation without compat concerns in future releases.
2424

2525
### Determine target framework
2626

27-
`net9.0` is the target framework version currently under development and the new apis
28-
should be added to `net9.0`. [More Information on TargetFrameworks](https://learn.microsoft.com/dotnet/standard/frameworks)
27+
`net10.0` is the target framework version currently under development and the new apis
28+
should be added to `net10.0`. [More Information on TargetFrameworks](https://learn.microsoft.com/dotnet/standard/frameworks)
2929

3030
## Making the changes in repo
3131

docs/coding-guidelines/libraries-packaging.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ In order to mitigate design-time/build-time performance issues with source gener
150150
### NETStandard Compatibility Error infrastructure
151151
For libraries that support .NETStandard, the _.NETStandard Compatibility packaging infrastructure_ makes sure that out-of-support target frameworks like _netcoreapp3.1_ or _net461_ are unsupported by the produced package. That enables library authors to support .NETStandard but explicitly not support unsupported .NETStandard compatible target frameworks.
152152

153-
The infrastructure generates a targets file that throws a user readable Error when msbuild invokes a project with an unsupported target framework. In addition to the targets file, placeholder files `_._` are placed into the minimum supported .NETStandard compatible target framework's package folder (as time of writing `net6.0` and `net462`), so that the generated targets files don't apply for that and any newer/compatible target framework. Example:
153+
The infrastructure generates a targets file that throws a user readable Error when msbuild invokes a project with an unsupported target framework. In addition to the targets file, placeholder files `_._` are placed into the minimum supported .NETStandard compatible target framework's package folder (as time of writing `net8.0` and `net462`), so that the generated targets files don't apply for that and any newer/compatible target framework. Example:
154154

155155
```
156156
buildTransitive\net461\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is generated and throws an Error
157157
buildTransitive\net462\_._
158158
buildTransitive\netcoreapp2.0\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is generated and throws an Error
159-
buildTransitive\net6.0\_._
159+
buildTransitive\net8.0\_._
160160
```
161161

162162
Whenever a library wants to author their own set of props and targets files (i.e. for source generators) and the above mentioned infrastructure kicks in (because the library targets .NETStandard), such files **must be included not only for the .NETStandard target framework but also for the specific minimum supported target frameworks**. The _.NETStandard Compatibility packaging infrastructure_ then omits the otherwise necessary placeholder files. Example:
@@ -166,7 +166,7 @@ buildTransitive\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.ta
166166
buildTransitive\net461\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is generated and throws an Error
167167
buildTransitive\net462\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is hand authored and doesn't throw an error
168168
buildTransitive\netcoreapp2.0\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is generated and throws an Error
169-
buildTransitive\net6.0\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is hand authored and doesn't throw an error
169+
buildTransitive\net8.0\Microsoft.Extensions.Configuration.UserSecrets.targets <- This file is hand authored and doesn't throw an error
170170
```
171171

172172
The above layout is achieved via the following item declaration in the project file. In that case, the hand authored msbuild props and/or targets files are located in a buildTransitive folder in the project tree. Note that the trailing directory separators are required.

docs/coding-guidelines/project-guidelines.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Below is a list of all the various options we pivot the project builds on:
2525
## Individual build properties
2626
The following are the properties associated with each build pivot
2727

28-
- `$(BuildTargetFramework) -> Any .NETCoreApp or .NETFramework TFM, e.g. net9.0`
28+
- `$(BuildTargetFramework) -> Any .NETCoreApp or .NETFramework TFM, e.g. net10.0`
2929
- `$(TargetOS) -> windows | linux | osx | freebsd | ... | [defaults to running OS when empty]`
3030
- `$(Configuration) -> Debug | Release | [defaults to Debug when empty]`
3131
- `$(TargetArchitecture) - x86 | x64 | arm | arm64 | [defaults to x64 when empty]`
@@ -59,7 +59,7 @@ A cross-targeting project which targets specific platform with `$(NetCoreAppCurr
5959
A full or individual project build is centered around BuildTargetFramework, TargetOS, Configuration and TargetArchitecture.
6060

6161
1. `$(BuildTargetFramework), $(TargetOS), $(Configuration), $(TargetArchitecture)` can individually be passed in to change the default values.
62-
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `net9.0-[TargetOS Running On]-Debug-x64`.
62+
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `net10.0-[TargetOS Running On]-Debug-x64`.
6363
3. When building an individual project (either from the CLI or an IDE), all target frameworks are built.
6464

6565
Any of the mentioned properties can be set via `/p:<Property>=<Value>` at the command line. When building using any of the wrapper scripts around it (i.e. build.cmd) a number of these properties have aliases which make them easier to pass (run build.cmd/sh -? for the aliases).
@@ -163,7 +163,7 @@ In the src directory for a library there should be only **one** `.csproj` file t
163163

164164
All libraries should use `<Reference Include="..." />` for all their references to libraries that compose the shared framework of the current .NETCoreApp. That will cause them to be resolved against the locally built targeting pack which is located at `artifacts\bin\microsoft.netcore.app.ref`. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts.
165165

166-
Other target frameworks than .NETCoreApp latest (i.e. `netstandard2.0`, `net462`, `net6.0`) should use ProjectReference items to reference dependencies.
166+
Other target frameworks than .NETCoreApp latest (i.e. `netstandard2.0`, `net462`, `net8.0`) should use ProjectReference items to reference dependencies.
167167

168168
### src\ILLink
169169
Contains the files used to direct the trimming tool. See [ILLink files](../workflow/trimming/ILLink-files.md).

docs/project/dogfooding.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ This is the default case for applications - running against an installed .NET ru
124124
```XML
125125
<PropertyGroup>
126126
<OutputType>Exe</OutputType>
127-
<!-- Ensure that the target framework is correct e.g. 'net9.0' -->
128-
<TargetFramework>net9.0</TargetFramework>
127+
<!-- Ensure that the target framework is correct e.g. 'net10.0' -->
128+
<TargetFramework>net10.0</TargetFramework>
129129
<!-- modify version in this line with one reported by `dotnet --info` under ".NET runtimes installed" -> Microsoft.NETCore.App -->
130130
<RuntimeFrameworkVersion>9.0.0-preview.5.22224.3</RuntimeFrameworkVersion>
131131
</PropertyGroup>
@@ -147,8 +147,8 @@ make it self-contained by adding a RuntimeIdentifier (RID).
147147
```XML
148148
<PropertyGroup>
149149
<OutputType>Exe</OutputType>
150-
<!-- Ensure that the target framework is correct e.g. 'net9.0' -->
151-
<TargetFramework>net9.0</TargetFramework>
150+
<!-- Ensure that the target framework is correct e.g. 'net10.0' -->
151+
<TargetFramework>net10.0</TargetFramework>
152152
<!-- modify build in this line with version reported by `dotnet --info` as above under ".NET runtimes installed" -> Microsoft.NETCore.App -->
153153
<!-- moreover, this can be any valid Microsoft.NETCore.App package version from https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json -->
154154
<RuntimeFrameworkVersion>9.0.0-preview.5.22224.3</RuntimeFrameworkVersion>
@@ -159,7 +159,7 @@ make it self-contained by adding a RuntimeIdentifier (RID).
159159
```
160160
$ dotnet restore
161161
$ dotnet publish
162-
$ bin\Debug\net9.0\win-x64\publish\App.exe
162+
$ bin\Debug\net10.0\win-x64\publish\App.exe
163163
```
164164

165165
### Daily builds table

docs/project/glossary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ terminology.
4949
| SPCL | `System.Private.CoreLib` - the lowest managed assembly in the libraries stack that contains `System.Object`, `String`, etc. |
5050
| SuperPMI | JIT component test framework (super fast JIT testing - it mocks/replays EE in EE-JIT interface) - see [SuperPMI details](https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/superpmi/readme.md). |
5151
| SVR | The CLR used to be built as two variants, with one called "mscorsvr.dll", to mean the "server" version. In particular, it contained the server GC implementation, which was intended for multi-threaded apps capable of taking advantage of multiple processors. In the .NET Framework 2 release, the two variants were merged into "mscorwks.dll". The WKS version was the default, however the SVR version remained available. |
52-
| TFM | [Target Framework Moniker](https://learn.microsoft.com/dotnet/standard/frameworks) such as `net6.0` or `netstandard2.0`. |
52+
| TFM | [Target Framework Moniker](https://learn.microsoft.com/dotnet/standard/frameworks) such as `net8.0` or `netstandard2.0`. |
5353
| TPA | Trusted Platform Assemblies used to be a special set of assemblies that comprised the platform assemblies, when it was originally designed. As of today, it is simply the set of assemblies known to constitute the application. |
5454
| URT | Universal Runtime. Ancient name for what ended up being .NET, is used in the WinError facility name FACILITY_URT. |
5555
| UTC | [Universal Tuple Compiler](https://blogs.msdn.microsoft.com/vcblog/2013/06/12/optimizing-c-code-overview/). The Microsoft C++ optimizer back-end that starts by converting the information from the FrontEnd into tuples – a binary stream of instructions. |

docs/workflow/building/coreclr/nativeaot.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The paths to major components can be overridden using `IlcToolsPath`, `IlcSdkPat
2727
Run `build[.cmd|.sh] -c Release` from the repo root to build the NativeAOT toolchain packages. The build will place the toolchain packages at `artifacts\packages\Release\Shipping`. To publish your project using these packages:
2828

2929
* Add the package directory to your `nuget.config` file. For example, add `<add key="local" value="C:\runtime\artifacts\packages\Release\Shipping" />`
30-
* Run `dotnet add package Microsoft.DotNet.ILCompiler -v 9.0.0-dev` to add the local package reference to your project.
30+
* Run `dotnet add package Microsoft.DotNet.ILCompiler -v 10.0.0-dev` to add the local package reference to your project.
3131
* Run `dotnet publish --packages pkg -r [win-x64|linux-x64|osx-64] -c [Debug|Release]` to publish your project. `--packages pkg` option restores the package into a local directory that is easy to cleanup once you are done. It avoids polluting the global nuget cache with your locally built dev package.
3232

3333
## High Level Overview
@@ -62,7 +62,7 @@ Typical workflow for working on the compiler:
6262
* Open `ilc.sln` in Visual Studio
6363
* Set "ILCompiler" project in solution explorer as your startup project
6464
* Set Working directory in the project Debug options to your test project directory, e.g. `C:\test`
65-
* Set Application arguments in the project Debug options to the response file that was generated by regular native aot publishing of your test project, e.g. `@obj\Release\net6.0\win-x64\native\HelloWorld.ilc.rsp`
65+
* Set Application arguments in the project Debug options to the response file that was generated by regular native aot publishing of your test project, e.g. `@obj\Release\net8.0\win-x64\native\HelloWorld.ilc.rsp`
6666
* Build & run using **F5**
6767

6868
## Convenience Visual Studio "repro" project

docs/workflow/building/libraries/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The libraries build has two logical components, the native build which produces
7676

7777
The build settings (BuildTargetFramework, TargetOS, Configuration, Architecture) are generally defaulted based on where you are building (i.e. which OS or which architecture) but we have a few shortcuts for the individual properties that can be passed to the build scripts:
7878

79-
- `-framework|-f` identifies the target framework for the build. Possible values include `net9.0` (currently the latest .NET version) or `net48` (the latest .NET Framework version). (msbuild property `BuildTargetFramework`)
79+
- `-framework|-f` identifies the target framework for the build. Possible values include `net10.0` (currently the latest .NET version) or `net48` (the latest .NET Framework version). (msbuild property `BuildTargetFramework`)
8080
- `-os` identifies the OS for the build. It defaults to the OS you are running on but possible values include `windows`, `unix`, `linux`, or `osx`. (msbuild property `TargetOS`)
8181
- `-configuration|-c Debug|Release` controls the optimization level the compilers use for the build. It defaults to `Debug`. (msbuild property `Configuration`)
8282
- `-arch` identifies the architecture for the build. It defaults to `x64` but possible values include `x64`, `x86`, `arm`, or `arm64`. (msbuild property `TargetArchitecture`)

0 commit comments

Comments
 (0)