A .NET 3.5 solution ended up with this warning when compiling with msbuild.
Sometimes NDepend might help out but in this case it didn't give any further details. Like Bob I ended up having to resort to opening each assembly in ILDASM until I found the one that was referencing an older version of the dependant assembly.
I did try using MSBUILD from VS 2010 Beta 2 (as the Connect article indicated this was fixed in the next version of the CLR) but that didn't provide any more detail either (maybe fixed post Beta 2)
Is there a better (more automated) approach?
Use a dependency reader
Using dep.exe you can list out all the nested dependencies of an entire folder. Combined with unix tools like grep or awk, it can help you to solve your problem
Finding assemblies being referenced in more than one version
This obscure command line runs dep.exe then pipes the output twice to awk to
Understanding how this assembly got pulled in your bin
In this example, the tool would show you that System.Web.Http 5.2.3 comes from your dependency to FooLib whereas the version 4.0.0 comes from BarLib.
Then you have the choice between
How to run these thing in Windows
If you don't have a unix type shell you'll need to download one before being able to run
awk
andgrep
. Try one of the followingA simplest way without without one taking into account of (internal) dependencies :
In my case, there was a problem with MySQL reference. Somehow, I could list three versions of it under the list of all available references. I followed process 1 through 6 above and it worked for me.
Visual Studio for Mac Community addition:
As AMissico's answer requires changing the log level, and neither ASMSpy nor ASMSpyPlus are available as a cross-platform solution, here is a short addition for Visual Studio for Mac:
It's in Visual Studio Community → Preferences... → Projects → Build Log → verbosity
I had the same error and could not figure it out with the other answers. I found that we can "Consolidate" NuGet packages.
Quick Fix:
Right click on solution -> Manage NuGet packages for solution -> Under Consolidate you can see if there are different versions of the same package were installed. Uninstall different versions and install the latest one.
ASP.NET build manager is building the website by going through the folders alphabetically, and for each folder it figures out it dependencies and builds the dependencies first and then the selected folder.
In this case the problematic folder which is ~/Controls, is selected to be built at the beginning, from yet an unknown reason, it builds some of the controls there as a separate assembly instead of inside the same assembly as other controls (seems to be connected to the fact that some controls are dependent on other controls in the same folder).
Then the next folder which is built (~/File-Center/Control) is dependent on the root folder ~/ which is dependent on ~/Controls, so the folder ~/Controls is being built again only this time the controls which were separated to their own assembly are now joined to the same assembly as other controls with the separated assembly still being referenced.
So at this point 2 assembly (at least) have the same controls and the build fails.
Although we still don't know why this happened, we were able to work around it by changing the Controls folder name to ZControls, this way it is not built before ~/File-Center/Control, only after and this way it is built as it should.