9
votes

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.

2
How many projects in your solution? You need to check .exe projects not .dll projects with regards to app.config.MickyD
About 75 projects total. What do you mean to check .exe projects instead of .dll projects? I am looking at app.config in the source folder, not in the build output folder.BlueTriangles
The warnings lists which project: [C:\MyEnlistment\Source\MyProject\MyProject.csproj]. That is why I am checking this MyProject folder and looking at its app.config, which does not contain any explicit binding redirects.BlueTriangles
Thank-you for clarification.MickyD

2 Answers

5
votes

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.
1
votes

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.