Question

Looking at the Web.config runtime section that opens with:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

follows is a list of depen. Asse. where inside the bindingRedirect the 'newVersion="valu" ' does not always match to what Nuget reports.

Is this something to rectify or ignore?

thx

Was it helpful?

Solution

By NuGet reports I assuming you mean the version number that NuGet shows for a particular NuGet package.

First of all, the NuGet package version does not necessarily match the version of the assembly or assemblies in the package. So the binding redirect version may be different. A good example of this is log4net:

log4net NuGet package version: 2.0.3
log4net assembly version: 1.2.13

So if one of your NuGet packages is referencing an older version of log4net, whilst your project is referencing the latest version, then I would expect a binding redirect to be added which refers to log4net 1.2.13.

NuGet will add binding redirects when a package is installed. You can also manually get NuGet to update the binding redirects for a project by running the Add-BindingRedirect command in the Package Manager Console window.

Add-BindingRedirect MyProjectName

If on rebuilding your entire solution you get a warning that looks like:

MSB3247 - Found conflicts between different versions of the same dependent assembly

Then you should look into fixing the binding redirects or seeing if you can upgrade the older NuGet packages so the conflicts are resolved that way. Otherwise your application may fail to load a particular assembly.

Visual Studio 2013 supports automatic binding redirection for applications that .NET Framework 4.5.1 which is another thing to consider if this applies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top