WindowsAppSDK: [.NET 8 RC1] Error NETSDK1083 "The specified RuntimeIdentifier 'win10-x86' is not recognized" displays in error list after creating a WinUI project

Describe the bug

There are 3 errors in error list after creating C# WinUI project with .NET 8 RC1. Errors: Error NETSDK1083: The specified RuntimeIdentifier ‘win10-x86’ is not recognized. Error NETSDK1083: The specified RuntimeIdentifier ‘win10-x64’ is not recognized. Error NETSDK1083: The specified RuntimeIdentifier ‘win10-arm64’ is not recognized.

From the https://github.com/dotnet/docs/issues/36527, we try to update the <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers> to <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>, there still an error: The specified RuntimeIdentifier ‘win10-x86’ is not recognized. image

Steps to reproduce the bug

Steps:

  1. Install VS from Pipelines - Run main-34029.95 (Contains the .NET 8 RC1)
  2. Create C# “Blank App. Packaged (WinUI 3 in Desktop)” project
  3. Open xxx.csproj file and update the TargetFramework to “net8.0-windows10.0.19041.0”
  4. Save
  5. Open the Error list to check the errors.

Actual Result: There are 3 errors. image

Expected behavior

No errors and warnings.

Screenshots

No response

NuGet package version

None

Windows version

Windows 11 (22H2): Build 22621

Additional context

Environment: VS version: 17.8.0 Preview 2.0 [34029.95.main] Windows App SDK version: 1.3.230602002

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 20
  • Comments: 28 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@eduardobragaxz Thanks for the workaround, setting <UseRidGraph>true</UseRidGraph> makes it work.

So… is there a patch incoming now that this excuse is no longer applicable ? 😁 From release notes: image

Any info on confirming whether this is getting any visibility for a fix, and whether a fix is planned (github has a nice milestone feature you could use to show intent), would be helpful.

@eduardobragaxz Thanks for the workaround, setting <UseRidGraph>true</UseRidGraph> makes it work.

Out of curiosity: The linked guide mentions to add

<ItemGroup>
  <RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
</ItemGroup>

to the csproj file. Thanks to your comment (which I discovered very late 😕 ) I recognized I actually had to add

<PropertyGroup>
    <UseRidGraph>true</UseRidGraph>
  </PropertyGroup>

to my csproj file. At least now one of my Maui 8 RC1 app can be built again without dotnet restore|publish crashing on me.

  1. How did you know this was the right property? Have I overlooked some obvious documentation?
  2. Why is the wrong (?) snippet still in the docs as “Recommended action” ?

Why would we set use RID graph to true - isn’t the point of this to remove the use of RID graphs? This is a horrible situation. Why should we have to do <arcane manipulations> to make our projects work? I do expect to be able to switch to .net 8 and my projects ‘just work’.

Yes. Or set in once in your Directory.build.props file

This is being addressed, the older non-portable RIDs found in the project templates and publish profiles will be replaced with generic portable RIDs. The NuGet package will also no longer contain or reference non-portable RIDs in its use of runtime libraries. These changes are scheduled for the 1.5 Experimental release.

@kmgallahan

The reason we have retained the older non-portable RIDs in the current version is to avoid introducing a breaking change in a servicing release for users who are simply upgrading their NuGet package version.

In an upcoming minor release we will be aligning more closely with the .NET 8 standards. This means that the older, non-portable RIDs will be phased out in favor of the more general, portable RIDs as per the .NET 8 guidelines

Same issue faced on MAUI with .NET 8.

I used this workaround in a cross-platform class library. It shut off the initial error but now I receive another:

NETSDK1082	There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'win10-arm'.	
NETSDK1082	There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'win10-arm-aot'.	

How we go forward with this right now? We cannot build our project for .NET 8 due to this error. Should we set <UseRidGraph>true</UseRidGraph> for every single class library and dependency?

@Gavin-Williams the .NET team made a breaking change on purpose. Not all libraries have had a chance to accommodate this yet, including windows app sdk. But the .net team was clever enough to provide a compatibility switch to use until all libraries in the ecosystem has caught up. So that is why you need to do this.

I don’t really see the big issue here (albeit I’d like to have seen all the Microsoft sdks being ready for this change but I get that might not be so easy to coordinate). If anything you should take it up in the dotnet/runtime repo, but at this point net8 shipped so the boat has sailed.