Reputation: 6766
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
Reputation: 127
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
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
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
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
Reputation: 6766
What I had to do is:
Upvotes: -3
Reputation: 7727
You can try to delete the bin
and obj
folders in the project, then restart VS and rebuild the project.
Upvotes: 17