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:
obj
folders.vs
folder (optional, if you get red lines but it builds OK)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:
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With