The explicit binding redirect conflicts with an autogenerated binding redirect

Viewed 6541

I am receiving the following warning when I build my solution:

The explicit binding redirect on "Microsoft.Azure.Documents.Client, Culture=neutral, PublicKeyToken=31bf3856ad364e35" conflicts with an autogenerated binding redirect. Consider removing it from the application configuration file or disabling autogenerated binding redirects. The build will replace it with: "< bindingRedirect oldVersion="0.0.0.0-1.22.0.0" newVersion="1.22.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />"

However, my app.config file in the project is only the following, without any explicit assembly binding redirects:

<configuration></configuration>

Why is there a conflict if I do not have any explicit binding redirects? My csproj file does not have any mention of AutoGenerateBindingRedirects, for the record.

4 Answers

For some reason VS head got a bit scrambled (VS 2019 Preview 2)

To completely clear this error I had to do the following:

  • Remove all references to said dll
  • Remove all instances of dll in packages bin or packages folder
  • Rebuild project / solution
  • Reinstall via nuget

It seems as if VS caches the DLL in memory and keeps referencing it or there is some other hidden setting which causes this behaviour. Prior to this (unsuccesfully) i tried:

  • Uninstalled / reinstalled packages via Nuget multiple times across all projects
  • Cleaned the app.config of explicit binding redirects
  • Restarted VS.

I had a similar issue, the sequence that fixed it for me was:

  1. Remove problematic dependency entry from App.config
  2. Un-check Auto-generate binding redirects from project properties
  3. Uninstall & Reinstall nuget package that required the dependency
  4. In my case, it prompted me to now re-check the Auto-generate binding redirects in my project properties.

For me the problem got solved by following the below steps:

  • Removing the specific conflict from App.Config
  • Rebuilding the solution.

This warning would not pop up any more in the project or solution in VS.

You should change assembly version Microsoft.Azure.Documents.Client in app.config on 1.22.0.0

Related