How can I fix assembly version conflicts with JSON.NET after updating NuGet package references in a new ASP.NET MVC 5 project?

后端 未结 11 1622
粉色の甜心
粉色の甜心 2020-11-29 20:42

I created a new ASP.NET MVC 5 web project in VS 2013 (Update 1) then updated all NuGet packages. When I build the project, I get the following warning:

<
11条回答
  •  清歌不尽
    2020-11-29 21:10

    I upgraded from Newtonsoft.Json 11.0.1 to 12.0.2. Opening the project file in Notepad++ I discovered both

    
          ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll
        
    

    and

    
        
          ..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll
        
      
    

    I deleted the ItemGroup wrapping the reference with the hint path to version 11.0.1.

    These issues can be insanely frustrating to find. What's more, developers often follow the same steps as previous project setups. The prior setups didn't encounter the issue. For whatever reason the project file occasionally is updated incorrectly.

    I desperately wish Microsoft would fix these visual studio DLL hell issues from popping up. It happens far too often and causing progress to screech to a halt until it is fixed, often by trial and error.

提交回复
热议问题