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:
<
Remember that with the binding redirection
oldVersion="0.0.0.0-6.0.0.0"
You are saying that the old versions of the dll are between version 0.0.0.0 and version 6.0.0.0.
Okay, hopefully this should help resolve any (sane) assembly reference discrepancies ...
Rejoice.
No one mentioned the following, which in my understanding is the correct solution:
Go the csproj of the project where the nuget is installed, and set the AutoGEneratedBindingRedirects
to false
.
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
Full article in MSDN.
I had similar issue and just wanted to post an answer for others in my situation.
I have a solution running a ASP.NET Web Application with multiple other C# class lib projects.
My ASP.NET Web Application wasn't using json, but other projects where.
This is how I fixed it:
Step 2 was first of all adding a configuration information for json, that suggest that all projects, use the latest version (6) no matter what version they have. Adding the assembly binding to Web.Config is most likely the fix.
However, step 2 also cleaned up som legacy code. It turned out we have previously used an old version (5) of json in our Web Application and the NuGet folders wasn't deleted when the reference was (I suspect: manually) removed. Adding the latest json (6), removed the old folders (json v5). This might be part of the fix as well.
Veverke mentioned that it is possible to disable generation of binding redirects by setting AutoGEneratedBindingRedirects to false. Not sure if it's a new thing since this question was posted, but there is an "Skip applying binding redirects" option in Tools/Options/Nuget Packet Manager, which can be toggled. By default it is off, meaning the redirects will be applied. However if you do this, you will have to manage any necessary binding redirects manually.