Skip to content

Commit

Permalink
Update the sdk target to net10.0 (#43015)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Mitchell (.NET) <mmitche@microsoft.com>
Co-authored-by: Marc Paine <marcpop@microsoft.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Ella Hathaway <ellahathaway@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
Co-authored-by: Matt Thalman <mthalman@microsoft.com>
Co-authored-by: Noah Gilson <noahgilson@microsoft.com>
  • Loading branch information
10 people authored Nov 5, 2024
1 parent 14417f1 commit ffd7663
Show file tree
Hide file tree
Showing 73 changed files with 808 additions and 489 deletions.
4 changes: 3 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
<!-- Default to all packages generating a corresponding symbol package -->
<IncludeSymbols>true</IncludeSymbols>
<IsShippingPackage>false</IsShippingPackage>
<SdkTargetFramework>net9.0</SdkTargetFramework>
<SdkTargetFramework>net10.0</SdkTargetFramework>
<!-- TODO: Remove when Arcade updated NetCurrent to net10.0. -->
<NetCurrent>net10.0</NetCurrent>
<ToolsetTargetFramework>$(SdkTargetFramework)</ToolsetTargetFramework>
<VisualStudioServiceTargetFramework>net8.0</VisualStudioServiceTargetFramework>

Expand Down
1 change: 1 addition & 0 deletions eng/restore-toolset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function InitializeCustomSDKToolset {
InstallDotNetSharedFramework "6.0.0"
InstallDotNetSharedFramework "7.0.0"
InstallDotNetSharedFramework "8.0.0"
InstallDotNetSharedFramework "9.0.0-rc.2.24473.5"

CreateBuildEnvScripts
CreateVSShortcut
Expand Down
1 change: 1 addition & 0 deletions eng/restore-toolset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function InitializeCustomSDKToolset {
InstallDotNetSharedFramework "6.0.0"
InstallDotNetSharedFramework "7.0.0"
InstallDotNetSharedFramework "8.0.0"
InstallDotNetSharedFramework "9.0.0-rc.2.24473.5"

CreateBuildEnvScript
}
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "9.0.100-rc.2.24474.11",
"dotnet": "10.0.100-alpha.1.24551.9",
"runtimes": {
"dotnet": [
"$(VSRedistCommonNetCoreSharedFrameworkx64100PackageVersion)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<!-- 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'">net9.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net10.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\$(_BlazorWebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll</_BlazorWebAssemblySdkTasksAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net9.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net10.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
</PropertyGroup>

<UsingTask TaskName="Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson50" AssemblyFile="$(_BlazorWebAssemblySdkTasksAssembly)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<!-- 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'">net9.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net10.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\$(_BlazorWebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll</_BlazorWebAssemblySdkTasksAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net9.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net10.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
</PropertyGroup>

<UsingTask TaskName="Microsoft.NET.Sdk.BlazorWebAssembly.CreateBlazorTrimmerRootDescriptorFile" AssemblyFile="$(_BlazorWebAssemblySdkTasksAssembly)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- A flag representing this package existing in a project. -->
<SDKContainerSupportEnabled>true</SDKContainerSupportEnabled>
<ContainerTaskFolderName>tasks</ContainerTaskFolderName>
<ContainerTaskFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">net9.0</ContainerTaskFramework>
<ContainerTaskFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">net10.0</ContainerTaskFramework>
<ContainerTaskFramework Condition="'$(MSBuildRuntimeType)' == 'Full'">net472</ContainerTaskFramework>
<ContainerizeFolderName>containerize</ContainerizeFolderName>
<!--The folder where the custom task will be present. It points to inside the nuget package. -->
Expand Down
4 changes: 2 additions & 2 deletions src/Installer/redist-installer/targets/Crossgen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
no that we do not silently miss cross-genning some bits. When a TFM for a tool is updated,
update its path explicitly. If all TFMs match, update DefaultToolTfm -->
<PropertyGroup>
<DefaultToolTfm>net9.0</DefaultToolTfm>
<DefaultToolTfm>net10.0</DefaultToolTfm>

<NetSdkTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk\tools\$(DefaultToolTfm)\</NetSdkTools>
<BlazorWasmTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\tools\$(DefaultToolTfm)\</BlazorWasmTools>
<NuGetPackTools>$(SdkOutputDirectory)Sdks\NuGet.Build.Tasks.Pack\CoreCLR\</NuGetPackTools>
<RazorTasks>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.Razor\tasks\$(DefaultToolTfm)\</RazorTasks>
<WindowsDesktopTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.WindowsDesktop\tools\$(DefaultToolTfm)\</WindowsDesktopTools>
<WindowsDesktopTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.WindowsDesktop\tools\net9.0\</WindowsDesktopTools>
<PublishTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.Publish\tools\$(DefaultToolTfm)\</PublishTools>
<WebTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.Web\tools\$(DefaultToolTfm)\</WebTools>
<ProjectSystemTools>$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.Web.ProjectSystem\tools\$(DefaultToolTfm)\</ProjectSystemTools>
Expand Down
2 changes: 1 addition & 1 deletion src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- Paths to tools, tasks, and extensions are calculated relative to the RazorSdkDirectoryRoot. This can be modified to test a local build. -->
<RazorSdkDirectoryRoot Condition="'$(RazorSdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</RazorSdkDirectoryRoot>
<RazorSdkBuildTasksDirectoryRoot Condition="'$(RazorSdkBuildTasksDirectoryRoot)'==''">$(RazorSdkDirectoryRoot)tasks\</RazorSdkBuildTasksDirectoryRoot>
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net9.0</_RazorSdkTasksTFM>
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net10.0</_RazorSdkTasksTFM>
<_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net472</_RazorSdkTasksTFM>
<RazorSdkBuildTasksAssembly>$(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll</RazorSdkBuildTasksAssembly>
<_RazorSdkToolAssembly>$(RazorSdkDirectoryRoot)tools\rzc.dll</_RazorSdkToolAssembly>
Expand Down
2 changes: 1 addition & 1 deletion src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>

<!-- TargetFrameworkDefaults.props -->
<NetCurrent>net9.0</NetCurrent>
<NetCurrent>net10.0</NetCurrent>
</PropertyGroup>

<!-- Manually import the Versions.props file when the Arcade SDK isn't used. -->
Expand Down
2 changes: 1 addition & 1 deletion src/SourceBuild/content/eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
-->
<PrivateSourceBuiltSdkVersion>9.0.100-rc.2.24474.1</PrivateSourceBuiltSdkVersion>
<PrivateSourceBuiltArtifactsVersion>9.0.100-rc.2.24474.1</PrivateSourceBuiltArtifactsVersion>
<PrivateSourceBuiltPrebuiltsVersion>0.1.0-10.0.100-1</PrivateSourceBuiltPrebuiltsVersion>
<PrivateSourceBuiltPrebuiltsVersion>0.1.0-10.0.100-4</PrivateSourceBuiltPrebuiltsVersion>
<!-- command-line-api dependencies -->
<SystemCommandLineVersion>2.0.0-beta4.24126.1</SystemCommandLineVersion>
<!-- msbuild dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion src/SourceBuild/content/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "9.0.100-rc.2.24474.11"
"dotnet": "10.0.100-alpha.1.24551.9"
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "3.7.0",
Expand Down
3 changes: 3 additions & 0 deletions src/SourceBuild/content/repo-projects/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<BuildArgs Condition="'$(DotNetBuildMonoBundleLLVMOptimizer)' != ''">$(BuildArgs) /p:DotNetBuildMonoBundleLLVMOptimizer=$(DotNetBuildMonoBundleLLVMOptimizer)</BuildArgs>
<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) $(FlagParameterPrefix)pgoinstrument</BuildArgs>
<BuildArgs Condition="'$(UseSystemLibs)' != ''">$(BuildArgs) /p:UseSystemLibs=$(UseSystemLibs)</BuildArgs>

<!-- Needed until https://github.com/dotnet/runtime/issues/109329 is fixed. -->
<BuildArgs>$(BuildArgs) /p:NetCoreAppToolCurrentVersion=10.0</BuildArgs>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
Expand Down
3 changes: 3 additions & 0 deletions src/SourceBuild/content/test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<VSTestResultsDirectory>$(ArtifactsTestResultsDir)</VSTestResultsDirectory>
<!-- Set roll forward to allow tests to run against a newer runtime. This is necessary when tests still
target a previous TFM but the SDK already provides the newer runtime. -->
<RollForward>Major</RollForward>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<DefaultExcludesInProjectFolder>$(DefaultExcludesInProjectFolder);assets/**/*</DefaultExcludesInProjectFolder>
<UBTestsWarnOnContentDiffs>true</UBTestsWarnOnContentDiffs>
<VSTestLogger>console%3bverbosity=diagnostic;trx%3bverbosity=diagnostic%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestCLIRunSettings>$(VSTestCLIRunSettings);RunConfiguration.DotNetHostPath=$(DotnetTool)</VSTestCLIRunSettings>
<VSTestCLIRunSettings>$(VSTestCLIRunSettings);RunConfiguration.DotNetHostPath=$(DotNetTool)</VSTestCLIRunSettings>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From c0c75f6fa385d6959cc2c7c475c01208f9f30830 Mon Sep 17 00:00:00 2001
From: Viktor Hofer <viktor.hofer@microsoft.com>
Date: Tue, 5 Nov 2024 13:37:06 +0100
Subject: [PATCH] Update workaround for STJ 8.0.0.4 version

Backport: https://github.com/dotnet/arcade/pull/15218

---
src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.targets | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.targets
index 492130d40..bae31b868 100644
--- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.targets
+++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.targets
@@ -197,7 +197,7 @@
<![CDATA[
try
{
- System.Reflection.Assembly.LoadFrom(@"$(MicrosoftNETBuildTasksDirectoryRoot)\..\..\..\DotnetTools\dotnet-format\BuildHost-net472\System.Text.Json.dll");
+ System.Reflection.Assembly.LoadFrom(@"$(MicrosoftNETBuildTasksDirectoryRoot)\..\..\..\Sdks\Microsoft.NET.Sdk.StaticWebAssets\tasks\net472\System.Text.Json.dll");
}
catch
{
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
From d6d8add5aad503877ee4344bce77dfa0b054752a Mon Sep 17 00:00:00 2001
From: Viktor Hofer <viktor.hofer@microsoft.com>
Date: Tue, 5 Nov 2024 14:53:29 +0000
Subject: [PATCH] Update SDK and remove net10 workaround

Backport: https://github.com/dotnet/windowsdesktop/pull/4763

---
Directory.Build.props | 2 +-
Directory.Build.targets | 18 ------------------
global.json | 2 +-
.../src/sfx/Directory.Build.targets | 12 ++++++++++++
4 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/Directory.Build.props b/Directory.Build.props
index 09e49d41..daf75b2f 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -26,7 +26,7 @@
<!-- Only upgrade NuGetAudit warnings to errors for official builds. -->
<WarningsNotAsErrors Condition="'$(OfficialBuild)' != 'true'">$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>

- <!-- Temporary, reove when arcade NetCurrent to net10. This requires a net10 targeting SDK -->
+ <!-- Temporary, remove when arcade NetCurrent to net10. This requires a net10 targeting SDK. -->
<NetCurrent>net10.0</NetCurrent>
</PropertyGroup>

diff --git a/Directory.Build.targets b/Directory.Build.targets
index d816857c..7b2a3390 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -10,22 +10,4 @@
<NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
</PropertyGroup>

- <ItemGroup>
- <!-- After the net10 SDK is available, this should change back to an Update without the TargetFramework property. -->
- <KnownFrameworkReference
- Include="@(KnownFrameworkReference->WithMetadataValue('TargetFramework', 'net9.0'))"
- DefaultRuntimeFrameworkVersion="$(MicrosoftNETCoreAppRefVersion)"
- LatestRuntimeFrameworkVersion="$(MicrosoftNETCoreAppRefVersion)"
- TargetingPackVersion="$(MicrosoftNETCoreAppRefVersion)"
- TargetFramework="net10.0" />
- <KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
- <KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App" />
- <KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App.WindowsForms" />
- <KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App.WPF" />
-
- <KnownCrossgen2Pack Include="@(KnownCrossgen2Pack->WithMetadataValue('TargetFramework', 'net9.0'))"
- Crossgen2PackVersion="$(MicrosoftNETCoreAppRefVersion)"
- TargetFramework="net10.0" />
- </ItemGroup>
-
</Project>
diff --git a/global.json b/global.json
index 0e7f27a5..412fb4a9 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"tools": {
- "dotnet": "9.0.100-rc.2.24474.11",
+ "dotnet": "10.0.100-alpha.1.24551.9",
"runtimes": {
"dotnet": [
"$(VSRedistCommonNetCoreSharedFrameworkx64100PackageVersion)"
diff --git a/src/windowsdesktop/src/sfx/Directory.Build.targets b/src/windowsdesktop/src/sfx/Directory.Build.targets
index 82de7dd9..ca14567b 100644
--- a/src/windowsdesktop/src/sfx/Directory.Build.targets
+++ b/src/windowsdesktop/src/sfx/Directory.Build.targets
@@ -2,6 +2,18 @@

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.targets))\Directory.Build.targets" />

+ <ItemGroup>
+ <KnownFrameworkReference
+ Update="Microsoft.NETCore.App"
+ DefaultRuntimeFrameworkVersion="$(MicrosoftNETCoreAppRefVersion)"
+ LatestRuntimeFrameworkVersion="$(MicrosoftNETCoreAppRefVersion)"
+ TargetingPackVersion="$(MicrosoftNETCoreAppRefVersion)" />
+ <KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
+ <KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App" />
+ <KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App.WindowsForms" />
+ <KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App.WPF" />
+ </ItemGroup>
+
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives" />
</ItemGroup>
Loading

0 comments on commit ffd7663

Please sign in to comment.