ekolis
ekolis

Reputation: 6766

Your project file doesn't list 'win10' as a "RuntimeIdentifier"... error when running Xamarin UWP project

Here is the full error:

Your project file doesn't list 'win10' as a "RuntimeIdentifier". You should add 'win10' to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

I opened up the csproj file in a text editor but I don't see any RuntimeIdentifiers property so I don't know where to add "win10"...

Upvotes: 10

Views: 14927

Answers (6)

Try changing the CPU architecture. The option on toolbar that may say "Any CPU", if then please change it to your preferred architecture (e.g. I use x64, use x86)

See the image for exact location of the option

Upvotes: 1

Marcus
Marcus

Reputation: 1

I found and fixed a very similar issue with a C# XAML app that showed the same error after adding arm64 target platform. The fix was to upgrade the NuGet PackageReference for Microsoft.NETCore.UniversalWindowsPlatform to be above version 6.2.x Restore NuGets and it will then build.

Upvotes: 0

magicandre1981
magicandre1981

Reputation: 28766

Unload the .csproj, open it in editor and add this:

 <PropertyGroup>
    <RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-arm64-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
 </PropertyGroup>

Save the csproj, reload it in VS and run nuget restore.

Upvotes: 12

Hakubex
Hakubex

Reputation: 154

same issue on my end. I was able to fix it by specifying platform target under the project's properties>Build. When I looked at it it didn't have anything selected.

Upvotes: 6

ekolis
ekolis

Reputation: 6766

What I had to do is:

  1. Create a brand new Xamarin app with a UWP project.
  2. Copy the contents of my original UWP project's csproj file into a text editor
  3. Copy the contents of the new UWP project file into the original.
  4. Replace anything like project names and GUIDs that got overwritten with the original values.

Upvotes: -3

Anran Zhang
Anran Zhang

Reputation: 7727

You can try to delete the bin and obj folders in the project, then restart VS and rebuild the project.

Upvotes: 17

Related Questions