user7242966 user7242966 - 1 year ago 347
Git Question

vs compiler complaining about missing reference in project.json but .net proj is not core

I have an MVC app which targets .NET f/w 4.5.2. I was copying over some files from a .NET core app on a previous branch. I installed a few npm packages on the previous branch. Now on my new clean branch which I just created from develop, VS is returning the following error:

Severity Code Description Project File Line Suppression State
Error Your project is not referencing the ".NETFramework,Version=v4.5.2" framework. Add a reference to ".NETFramework,Version=v4.5.2" in the "frameworks" section of your project.json, and then re-run NuGet restore. MyCompany.Website

I think project.json is a file specific to the .NET Core f/w so the compiler shouldn't be requiring a project.json update in a 4.5.2 app. What do I need to do to get around this error message? I tried "git clean -f" on this directory but the error still occurs. Any idea how to fix this?

Answer Source

I found the answer in another thread. Look for a project.lock.json file then delete it. Issue fixed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download