microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

[WinUI][.NET 8] Class Library build failed with a warning NETSDK1206

Open XamlTest opened this issue 2 years ago • 7 comments
trafficstars

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:

  1. Make sure .NET SDK(Preview) and .NET 8.0 Runtime are installed from installer.
  2. Add dotnet 8 feed: https://pkgs.dev.azure.com/dnceng/public/_packaging/8.0.100-preview.6.23330.14-shipping/nuget/v3/index.json
  3. Create a Class Library (WinUI 3 in Desktop) project.
  4. Update the TargetFramework to <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
  5. Save and Build

Expected Result: Build successfully without error.

Actual Result: There is a warning: NETSDK1206 image

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

XamlTest avatar Jul 03 '23 08:07 XamlTest

Is #8801 related?

michael-hawker avatar Oct 03 '23 21:10 michael-hawker

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.

Scottj1s avatar Jan 03 '24 17:01 Scottj1s

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:

  1. Create Class Library (WinUI 3 in Desktop).
  2. Build.

Actual: There is a Warning NETSDK1206. image

XamlTest avatar Mar 21 '24 08:03 XamlTest

Still seeing this in v1.5.240428000

molesmoke avatar May 21 '24 01:05 molesmoke

Still present in v1.5.240607001

jeremy-visionaid avatar Jun 12 '24 02:06 jeremy-visionaid

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.

dotMorten avatar Aug 08 '24 17:08 dotMorten

Still present in v1.5.240802000

cheapw avatar Aug 26 '24 09:08 cheapw

I'm told this is fixed in WinAppSDK 1.6 (likely via the fix for microsoft/WindowsAppSDK#4597).

codendone avatar Sep 30 '24 20:09 codendone