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

后端 未结 13 1448
余生分开走
余生分开走 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:35

    I had the same problem (in VS2012). No answer helped me. Finally I solved it by this:

    1) Go to TOOLS -> EXTENSIONS AND UPDATES here update (or install) "NuGet Package Manager" next go to "Online" and install "Quick add NuGet" and "NuGet References"

    2) after insttal all in 1) in your project right click to "References" and choose "Manage Nuget Packages" in "Installed packages" find Json.NET. Click Uninstall - you cannot do this now, but it show you what you must uninstall first (some ASP Web Api client). So uninstall all of these and try uninstall "Json.NET" again. Now go to "Online" and install "Json.NET", "ASP.NET WEB API Client Libraries" and "ASP.NET WEB API Client OData".

    3) in Global.asax delete row "WebApiConfig.Register(GlobalConfiguration.Configuration);"

    build solution and all shoud be ok.. I hope this can help someone :) gl

提交回复
热议问题