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

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

    I combined a couple of the options the other SO contributors stated, plus a new one.

    First, It turns out that Nuget 2.1 had some issues, and this issue was logged in a bug, and was fixed in 2.2.2. See here: https://nuget.codeplex.com/workitem/3050

    So, I did the following steps:

    1. Updated Nuget version to 2.2.2 as per the link
    2. Removed all references to Json in my project by uninstalling from NUget (right click project and find package, and uninstall (Even this didn't do it)
    3. Physically deleted the Package files from the computer. I found package files here: //projectdir/packages/Newtonsoft.JSON
    4. Deleted the packages.config file from the physical directory (//projectname/packages.config)
    5. Once this was all completed, I added Newtonsoft again via Nuget, then did a rebuild, and it worked.

提交回复
热议问题