Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
XamlTest opened this issue Aug 30, 2023 · 35 comments · Fixed by #4020
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration bug Something isn't working Status: Fixed internally The issue has been fixed but has not yet shipped in a release.
Milestone

Comments

@XamlTest
Copy link

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 dotnet/docs#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

@XamlTest XamlTest added the bug Something isn't working label Aug 30, 2023
@XamlTest
Copy link
Author

If update the the RuntimeIdentifier in xxx.csproj and also win10-x84.pubxml files, then application run successfully without error, but display 2 warnings.
image

@eduardobragaxz
Copy link

eduardobragaxz commented Aug 31, 2023

In the release notes for 1.4 stable they recommend you set UseRidGraph to true.

https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/8.0/rid-asset-list#recommended-action

@evelynwu-msft evelynwu-msft transferred this issue from microsoft/microsoft-ui-xaml Sep 6, 2023
@bpulliam bpulliam added the area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration label Sep 7, 2023
@XamlTest
Copy link
Author

XamlTest commented Sep 8, 2023

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

@eduardobragaxz
Copy link

eduardobragaxz commented Sep 8, 2023

@XamlTest you're welcome 😀

@DDHSchmidt
Copy link

@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" ?

@eduardobragaxz
Copy link

That's interesting. Mine works with the suggested one.

dotMorten added a commit to Esri/arcgis-maps-sdk-dotnet-toolkit that referenced this issue Sep 22, 2023
@mklemarczyk
Copy link

Please update documentation for this new requirement. Or make it not mandatory for final release of .NET 8.
PS: It would be nice if dotnet can write that suggestion in error message, so we do not need to wonder around. :)

Ref:

@dotMorten
Copy link
Contributor

dotMorten commented Nov 14, 2023

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.

@ShashankNay
Copy link
Contributor

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.

@orosbogdan
Copy link

Same issue faced on MAUI with .NET 8.

@e012345678
Copy link

Having the same issue on .NET 8 MAUI. How to fix this?

@eduardobragaxz
Copy link

eduardobragaxz commented Nov 18, 2023

What exactly is the problem are you having? Did you guys add <UseRidGraph>true</UseRidGraph> to the project file and edited your publish profile files?

Although... might be different for MAUI, I'm not sure.

@dotMorten
Copy link
Contributor

Maui should be setting UseRidGraph for you

@e012345678
Copy link

The UseRidGraph needs to be set for every single dependency class library? The problem we are having is that the code doesn't compile. It gives the error
C:\hostedtoolcache\windows\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1083: The specified RuntimeIdentifier 'win10-x64' is not recognized.

@eduardobragaxz
Copy link

I don't know if the folder structure is the same with MAUI, but assuming it's the same, what I did was, using file explorer, I went to my project's folder then Properties > PublishProfiles and in the files in this folder I edited the RuntimeIdentifier property from, for example, win10-x64 to win-x64.

@e012345678
Copy link

We are not using publish profiles we are using dotnet publish from command. Tried a lot of different options but cannot get this to work in .NET 8. Getting this error:
error : Packaged .NET applications with an app host exe cannot be ProcessorArchitecture neutral. Please specify a RuntimeIdentifier or a Platform other than AnyCPU.

Getting this despite setting -r:win-x64as argument to dotnet publish

@eduardobragaxz
Copy link

Oh my bad.

@Gavin-Williams
Copy link

Gavin-Williams commented Nov 24, 2023

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'.

@dotMorten
Copy link
Contributor

@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.

@e012345678
Copy link

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?

@dotMorten
Copy link
Contributor

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

@abenadar
Copy link

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'.	

@Arlodotexe
Copy link

Arlodotexe commented Jan 11, 2024

The Windows Community Toolkit is running into this issue when adding a net8.0-windows10.0.22621.0 MultiTarget. Even after enabling UseRidGraph, we're still seeing:

C:\Program Files\dotnet\sdk\8.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(491,5): error NETSDK1082: There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'win10-arm'.
C:\Program Files\dotnet\sdk\8.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(491,5): error NETSDK1082: There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'win10-arm-aot'.

It's notable that we aren't defining win10-arm or win10-arm-aot anywhere in our project. All instance of the string win10-* were changed to win-* in this commit, and the binlog shows the RuntimeIdentifiers still being defined as:

RuntimeIdentifiers = win10-arm;win10-arm-aot;win10-arm64-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot

There was no change in behavior when updating to the latest stable version of Microsoft.WindowsAppSdk.

Single-project binlog: CommunityToolkit.WinUI.Converters_Debug_AnyCPU_Build_2024-01-10T18_40_33.4371927-06_00.zip

Can be reproduced at commit d03cc9 on the repo/branch CommunityToolkit/upgrade/wasdk/net8-windows

@kmgallahan
Copy link

@Arlodotexe @bpulliam A potential cause is that dependencies work their runtime targets into WinUI 3 library *.deps.json files like so:

Microsoft.Graphics.Win2D/1.0.0.30": {
  "runtime": {
    "lib/net5.0-windows10.0.18362.0/Microsoft.Graphics.Canvas.Interop.dll": {
      "assemblyVersion": "1.0.26.0",
      "fileVersion": "1.0.26.0"
    }
  },
  "runtimeTargets": {
    "runtimes/win10-arm64/native/Microsoft.Graphics.Canvas.dll": {
      "rid": "win10-arm64",
      "assetType": "native",
      "fileVersion": "1.0.0.0"
    },
    "runtimes/win10-x64/native/Microsoft.Graphics.Canvas.dll": {
      "rid": "win10-x64",
      "assetType": "native",
      "fileVersion": "1.0.0.0"
    },
    "runtimes/win10-x86/native/Microsoft.Graphics.Canvas.dll": {
      "rid": "win10-x86",
      "assetType": "native",
      "fileVersion": "1.0.0.0"
    }
  }
},

...

Microsoft.WindowsAppSDK/1.4.231115000": {
  "dependencies": {
    "Microsoft.Windows.SDK.BuildTools": "10.0.22621.2428"
  },
  "runtime": {
    ...
  },
  "runtimeTargets": {
    "runtimes/win10-arm64/native/Microsoft.WindowsAppRuntime.Bootstrap.dll": {
      "rid": "win10-arm64",
      "assetType": "native",
      "fileVersion": "1.4.0.0"
    },
    "runtimes/win10-x64/native/Microsoft.WindowsAppRuntime.Bootstrap.dll": {
      "rid": "win10-x64",
      "assetType": "native",
      "fileVersion": "1.4.0.0"
    },
    "runtimes/win10-x86/native/Microsoft.WindowsAppRuntime.Bootstrap.dll": {
      "rid": "win10-x86",
      "assetType": "native",
      "fileVersion": "1.4.0.0"
    }
  }
},

This is causing the following warning for me on build:

C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(284,5): warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): win10-arm64, win10-x64, win10-x86. Affected libraries: Microsoft.Graphics.Win2D, 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.

So even the WASDK package isn't setup or being consumed correctly during build yet.

@ShashankNay
Copy link
Contributor

@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

@dotMorten
Copy link
Contributor

dotMorten commented Jan 19, 2024

It really shouldn't be a breaking change, since for instance a win10-x64 RID would automatically include any win-x64 resources as well and that applies for .NET 6 too.

However, I can understand wanting to keep changes at a minimum in a patch release, and if it was between this quick-fix or waiting for 1.5.0 which it was initially promised for, I'm more than happy with the current temporary quick-fix.

@bpulliam
Copy link
Collaborator

bpulliam commented Feb 7, 2024

This is in 1.5 and can be confirmed in preview 1

@Diegorro98
Copy link

I'm having also this error, but in this case, the error happens at dependabot when tries to update a project with <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>. See dependabot/dependabot-core#9099

@dylanh724
Copy link

Hmm, so how to resolve this?

@mklemarczyk
Copy link

mklemarczyk commented Jun 19, 2024

No issue found on last release Visual Studio 2022 17.10.0, .NET SDK 8.0.300

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
    <RootNamespace>Trogon.ColumbaLivia</RootNamespace>
    <ApplicationIcon>Assets/WindowIcon.ico</ApplicationIcon>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <Platforms>x86;x64;arm64</Platforms>
    <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
    <PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <UseWinUI>true</UseWinUI>
    <EnableMsixTooling>true</EnableMsixTooling>
    <GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
  </PropertyGroup>

Be aware that win10-x86 is not longer a valid runtime identifier, any win10- prefix need to be changed to win-
Compiler prints a information about it in the output.

If someone is looking for more information, it can be found here.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/8.0/runtimeidentifier
https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/rid-graph

@karmeye
Copy link

karmeye commented Sep 24, 2024

I get

C:\Program Files\dotnet\sdk\8.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(284,5): warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): win10-arm64, win10-x64, win10-x86. Affected libraries: Microsoft.Graphics.Win2D. 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.

using

		<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
		<TargetPlatformMinVersion>10.0.22000.0</TargetPlatformMinVersion>
		<WindowsSdkPackageVersion>10.0.22621.41</WindowsSdkPackageVersion>
		<Platforms>x86;x64;ARM64</Platforms>
		<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>

Do I have to wait for this to be fixed in WinAppSDK? @kmgallahan

@ShashankNay
Copy link
Contributor

@karmeye can you provide a repro if possible? What version of the Windows App SDK are you using in your project?

@karmeye
Copy link

karmeye commented Sep 29, 2024

@karmeye can you provide a repro if possible? What version of the Windows App SDK are you using in your project?

I'm using 1.6.0.
Could it be because I'm using System.Drawing?

Here are the references used:

<ItemGroup>
	<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
	<PackageReference Include="CommunityToolkit.WinUI" Version="7.1.2" />
	<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.1.240916" />
	<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240916" />
	<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" />
	<PackageReference Include="CommunityToolkit.WinUI.Controls.TokenizingTextBox" Version="8.1.240916" />
	<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.1.240916" />
	<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.1.240916" />
	<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
	<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
		<PrivateAssets>all</PrivateAssets>
		<!--
			https://github.com/Microsoft/CsWin32#usage
			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
		-->
	</PackageReference>
	<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.3" />
	<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" />
	<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
	<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
	<PackageReference Include="NPOI" Version="2.7.0" />
</ItemGroup>
<ItemGroup>
	<COMReference Include="Microsoft.Office.Core">
		<WrapperTool>tlbimp</WrapperTool>
		<VersionMinor>8</VersionMinor>
		<VersionMajor>2</VersionMajor>
		<Guid>2df8d04c-5bfa-101b-bde5-00aa0044de52</Guid>
		<Lcid>0</Lcid>
		<Isolated>false</Isolated>
		<EmbedInteropTypes>true</EmbedInteropTypes>
	</COMReference>
	<COMReference Include="Microsoft.Office.Interop.Word">
		<WrapperTool>tlbimp</WrapperTool>
		<VersionMinor>7</VersionMinor>
		<VersionMajor>8</VersionMajor>
		<Guid>00020905-0000-0000-c000-000000000046</Guid>
		<Lcid>0</Lcid>
		<Isolated>false</Isolated>
		<EmbedInteropTypes>true</EmbedInteropTypes>
	</COMReference>
</ItemGroup>

@kmgallahan
Copy link

@karmeye Your first comment points out which library is causing the issue: Affected libraries: Microsoft.Graphics.Win2D. Only the maintainers of the lib can resolve the issue, unless WASDK changes how *.deps.json is made #3842 (comment).

@karmeye
Copy link

karmeye commented Sep 30, 2024

@kmgallahan Ok, I see. Should one open an issue about it?

I mean, it's just a warning now. Unless it affects building and the different publishing options, I guess it's not high prio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration bug Something isn't working Status: Fixed internally The issue has been fixed but has not yet shipped in a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.