microsoft-ui-xaml
microsoft-ui-xaml copied to clipboard
[WinUI][.NET 8] Class Library build failed with a warning NETSDK1206
Describe the bug
There is a warning after build Class Library (WinUI 3 in Desktop) project successfully with .NET 8.0.100-preview.6.23330.14.
Warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): win10-arm64, win10-x64, win10-x86. Affected libraries: Microsoft.WindowsAppSDK. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details.
Steps to reproduce the bug
Environment: OS Version: Win11x64 & Win11-ARM64 VS Build: 17.7.0 Preview 3.0 [33901.74.d17.7] .NET Version: .NET 8.0.100-preview.6.23330.14
More info: This issue does not reproduce on .NET 6.
Repro Steps:
- Make sure .NET SDK(Preview) and .NET 8.0 Runtime are installed from installer.
- Add dotnet 8 feed: https://pkgs.dev.azure.com/dnceng/public/_packaging/8.0.100-preview.6.23330.14-shipping/nuget/v3/index.json
- Create a Class Library (WinUI 3 in Desktop) project.
- Update the TargetFramework to
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> - Save and Build
Expected Result: Build successfully without error.
Actual Result:
There is a warning: NETSDK1206
Expected behavior
No response
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.3.2: 1.3.230602002
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
Is #8801 related?
Windows App SDK 1.4.4 will be released shortly and includes support for portable RIDs, so the UseRidGraph workaround will no longer be necessary.
We tried on the latest VS(17.10 Preview 3) and latest Windows App SDK(1.5.240311000), the issue still repro with below steps:
- Create Class Library (WinUI 3 in Desktop).
- Build.
Actual: There is a Warning NETSDK1206.
Still seeing this in v1.5.240428000
Still present in v1.5.240607001
The problem is that WinUI requires you to set the runtime identifiers, even if you're building an AnyCPU class library. We should not be setting runtime identifiers in an anycpu class library, and the warning tells us about this. However the way that the Windows App SDK has been authored it incorrectly requires this.
Still present in v1.5.240802000
I'm told this is fixed in WinAppSDK 1.6 (likely via the fix for microsoft/WindowsAppSDK#4597).