I’ve installed a new package on an existing project.
The problem is it’s detecting a different version of the Microsoft.Build.Framework
. I got Version=17.5.0
for both Microsoft.Build
and Microsoft.Build.Framework
but it’s seeing Version=15.1.0.0
.
I have the updated version of NuGet (Version 6.5.0) which is compatible with my Visual Studio (Version 17.5.5) which according to this answer should fix it.
I’ve also restarted Visual Studio and tried again, which should also fix it according to this answer.
Is there something more going on under the hood here?
2
Answers
Microsoft.Build.Locator solved my issue.
Go to the /Obj folder and take a backup copy of your project.assets.json file.
Edit the project.assets.json file removing the json chunks/segments that refer to the v15.1.0.0.
Now try to install the v=17.5.0 reference and Visual Studio shouldn’t get confused and load an old version.
If that fails you might want to delete your NuGet Cache using Visual Studio > Tools > Package Manager > Settings > click the Delete NuGet Packages button and then re-add the NuGet references via the Package Manager.