Visual Studio 2012 Web API project won't run - can't find Newtonsoft.Json

后端 未结 13 1427
余生分开走
余生分开走 2020-12-02 09:56

After running a clean solution and rebuild, my MVC 4 Web API project stops working. It\'s can\'t find Newtonsoft.Json.

I know that MS is using this as the default JS

13条回答
  •  情深已故
    2020-12-02 10:19

    What caused my problem with Newtonsoft.json was slightly different. I had developed a Windows app built against .Net 4.5. I later found out that the customer's environment only supported .Net 4.0. I had copied the solution to a new area to preserve the .Net 4.5 work and changed the Solution Properties to Microsoft.Net 4.0. I got the error that Newtonsoft.json could not be found and was I missing a reference.

    I followed the procedures stated above for removing the packages.config; removing Newtonsoft.json; ensuring that Newtonsoft.json was removed from the \packages directory; then reinstalling Newtonsoft.json from NuGet. I was able to compile and run the application with .Net 4.0

    Prior to this the packages.config file showed that the version of .Net that Newtonsoft.json targeted was .Net 4.5. Removing and adding the Newtonsoft.json now has the target as .Net 4.0.

提交回复
热议问题