From 31d4cf44932a4c5131258cfabe4a0dd0daf9aea5 Mon Sep 17 00:00:00 2001 From: Shashank Nayak Date: Mon, 27 Nov 2023 22:28:48 +0000 Subject: [PATCH] Merged PR 9926818: .NET 8 Breaking Changes and WindowsAppSDK IntegrationCopyFilesToStagingDir.ps1 .NET8 introduced a [conditional breaking change](https://github.com/dotnet/docs/issues/35398) that influences how the runtime host looks for RID-specific assets. In NET8, support for non-portable RIDs (runtime identifiers specific to versions and distributions, such as win10-x86) is discontinued. The folder structure of the Microsoft.WindowsAppSDK NuGet is structured with assets marked using these non-portable RIDs: ![image (4).png](https://dev.azure.com/microsoft/55e8140e-57ac-4e5f-8f9c-c7c15b51929d/_apis/git/repositories/2467406e-dc4e-49eb-b903-238f0da5a43e/pullRequests/9926818/attachments/image%20%284%29.png) The changes made to the `CopyFilesToStagingDir.ps1` script along with the project template changes should help support the .NET8 scenario. The selection of the project template's RIDs is conditional and based on the TFM chosen by the user. If NET8 is chosen, the RIDs become portable, enabling the runtime host to locate the RID-specific assets that were previously unattainable. --- build/CopyFilesToStagingDir.ps1 | 2 ++ .../Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj | 3 ++- .../CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj | 3 ++- .../{win10-arm64.pubxml => win-arm64.pubxml} | 3 ++- .../BlankApp/Properties/PublishProfiles/win-x64.pubxml} | 3 ++- .../BlankApp/Properties/PublishProfiles/win-x86.pubxml} | 3 ++- .../BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate | 6 +++--- .../CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj | 5 +++-- .../{win10-arm64.pubxml => win-arm64.pubxml} | 3 ++- .../Properties/PublishProfiles/win-x64.pubxml} | 3 ++- .../Properties/PublishProfiles/win-x86.pubxml} | 5 +++-- .../WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate | 6 +++--- 12 files changed, 28 insertions(+), 17 deletions(-) rename dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/{win10-arm64.pubxml => win-arm64.pubxml} (80%) rename dev/VSIX/ProjectTemplates/Desktop/CSharp/{SingleProjectPackagedApp/Properties/PublishProfiles/win10-x64.pubxml => PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml} (80%) rename dev/VSIX/ProjectTemplates/Desktop/CSharp/{SingleProjectPackagedApp/Properties/PublishProfiles/win10-x86.pubxml => PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml} (80%) rename dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/{win10-arm64.pubxml => win-arm64.pubxml} (80%) rename dev/VSIX/ProjectTemplates/Desktop/CSharp/{PackagedApp/BlankApp/Properties/PublishProfiles/win10-x64.pubxml => SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml} (80%) rename dev/VSIX/ProjectTemplates/Desktop/CSharp/{PackagedApp/BlankApp/Properties/PublishProfiles/win10-x86.pubxml => SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml} (77%) diff --git a/build/CopyFilesToStagingDir.ps1 b/build/CopyFilesToStagingDir.ps1 index 86d240c80a..7076a7b11f 100644 --- a/build/CopyFilesToStagingDir.ps1 +++ b/build/CopyFilesToStagingDir.ps1 @@ -137,7 +137,9 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Microsoft.WindowsAppRuntime.l # # MSIX Framework package - DLLs/EXEs PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Microsoft.WindowsAppRuntime.dll $NugetDir\runtimes\win10-$Platform\native +PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Microsoft.WindowsAppRuntime.dll $NugetDir\runtimes\win-$Platform\native PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Microsoft.WindowsAppRuntime.pdb $NugetDir\runtimes\win10-$Platform\native +PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Microsoft.WindowsAppRuntime.pdb $NugetDir\runtimes\win-$Platform\native PublishFile $FullBuildOutput\RestartAgent\RestartAgent.exe $NugetDir\runtimes\win10-$Platform\native PublishFile $FullBuildOutput\RestartAgent\RestartAgent.pdb $NugetDir\runtimes\win10-$Platform\native PublishFile $FullBuildOutput\DeploymentAgent\DeploymentAgent.exe $NugetDir\runtimes\win10-$Platform\native diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj b/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj index 8250dd7c5c..56f17b2367 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj @@ -3,7 +3,8 @@ $DotNetVersion$-windows10.0.19041.0 10.0.17763.0 $safeprojectname$ - win10-x86;win10-x64;win10-arm64 + win-x86;win-x64;win-arm64 + win10-x86;win10-x64;win10-arm64 true diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj index 3790b6b3b3..5617fa4d8a 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj @@ -6,7 +6,8 @@ $safeprojectname$ app.manifest x86;x64;ARM64 - win10-x86;win10-x64;win10-arm64 + win-x86;win-x64;win-arm64 + win10-x86;win10-x64;win10-arm64 true diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-arm64.pubxml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml similarity index 80% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-arm64.pubxml rename to dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml index 25349f2197..41c7279393 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-arm64.pubxml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml @@ -6,7 +6,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem ARM64 - win10-arm64 + win-arm64 + win10-arm64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-x64.pubxml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml similarity index 80% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-x64.pubxml rename to dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml index 4da0fea29b..a48aacf067 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-x64.pubxml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml @@ -6,7 +6,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem x64 - win10-x64 + win-x64 + win10-x64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-x86.pubxml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml similarity index 80% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-x86.pubxml rename to dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml index c94522ca94..5086e705b2 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-x86.pubxml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml @@ -6,7 +6,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem x86 - win10-x86 + win-x86 + win10-x86 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate index e9b8927622..ac639a7846 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate @@ -26,9 +26,9 @@ - Properties\PublishProfiles\win10-arm64.pubxml - Properties\PublishProfiles\win10-x64.pubxml - Properties\PublishProfiles\win10-x86.pubxml + Properties\PublishProfiles\win-arm64.pubxml + Properties\PublishProfiles\win-x64.pubxml + Properties\PublishProfiles\win-x86.pubxml app.manifest App.xaml App.xaml.cs diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj index 0794538bfb..9c03eac491 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj @@ -5,8 +5,9 @@ 10.0.17763.0 $safeprojectname$ app.manifest - x86;x64;ARM64 - win10-x86;win10-x64;win10-arm64 + x86;x64;ARM64 + win-x86;win-x64;win-arm64 + win10-x86;win10-x64;win10-arm64 win10-$(Platform).pubxml true true diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-arm64.pubxml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-arm64.pubxml similarity index 80% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-arm64.pubxml rename to dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-arm64.pubxml index 25349f2197..41c7279393 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win10-arm64.pubxml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-arm64.pubxml @@ -6,7 +6,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem ARM64 - win10-arm64 + win-arm64 + win10-arm64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-x64.pubxml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml similarity index 80% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-x64.pubxml rename to dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml index 4da0fea29b..a48aacf067 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-x64.pubxml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml @@ -6,7 +6,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem x64 - win10-x64 + win-x64 + win10-x64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-x86.pubxml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml similarity index 77% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-x86.pubxml rename to dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml index c94522ca94..26bd873dac 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win10-x86.pubxml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml @@ -5,8 +5,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - x86 - win10-x86 + x86 + win-x86 + win10-x86 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate index c5be3e488a..4fabf7faa5 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate @@ -31,9 +31,9 @@ Properties\launchSettings.json - Properties\PublishProfiles\win10-arm64.pubxml - Properties\PublishProfiles\win10-x64.pubxml - Properties\PublishProfiles\win10-x86.pubxml + Properties\PublishProfiles\win-arm64.pubxml + Properties\PublishProfiles\win-x64.pubxml + Properties\PublishProfiles\win-x86.pubxml app.manifest App.xaml App.xaml.cs