Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 15.8.2 broke build tools - missing RuntimeIdentifier

At some point before attempting to build, you need to delete the obj folder. More than one person showed this to solve the problem.

https://developercommunity.visualstudio.com/content/problem/312180/projects-fail-to-build-in-1580-due-to-errors-from.html


Although @Señor CMasMas's answer has helped me in the past, I'm now finding (since installing the .NET Core SDK v2.2 - I don't know if that's related though) that I also need to close and reopen Visual Studio. So for me the recipe is:

  • Clean solution
  • Delete obj folders
  • Delete the .vs folder (optional, if you get red lines but it builds OK)
  • Close and reopen Visual Studio
  • Then build

Add this: <RuntimeIdentifier>win</RuntimeIdentifier> to your project file, for example after element TargetFrameworkVersion. Make sure the element name is singular. RuntimeIdentifiers on the other hand is used in the new csproj format


Or you just can run in the root directory of your project the script in PowerShell that you should run as administrator.

Get-ChildItem .\ -include bin,obj -Recurse | foreach { remove-item $_.fullname -Force -Recurse }

this script will delete all obj and bin folders


you got to figure out which projects in your solution trigger this error. you can find this if you look at the error panel. go to that projects locations and delete both the bin and the obj folders. then rebuild. should be alright


I had a similar problem. My error was

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.

Well, it turned out I just had to change by build target from "Any CPU" to something else (x64 for example)...


I have a similar case. I try to build a solution via msbuild without installing Visual Studio 2017, just install the latest version of vs 2017 build tools. Here are my steps:

  1. dotnet restore a.sln (There are some .Net Standard Library project in this solution, the others are .NET 4.7.2 projects).
  2. call msbuild.exe to build this solution.
  3. I got the error of "missing RuntimeIdentifier".

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

It seems an issue in the old version of Nuget. Please refer here. Finally, I resolved it via restore packages with the latest Nuget (v5.0.2). the steps:

  1. Delete obj and bin folders
  2. nuget.exe restore a.sln
  3. call msbuild.exe