Do you ever get these kinds of messages when you compile your project?
------ Build started: Project: Suteki.Shop.CreateDb, Configuration: Debug x86 ------ No way to resolve conflict between "System.Web.Mvc, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily. Consider app.config remapping of assembly "NHibernate, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" from Version "22.214.171.1241"  to Version "126.96.36.19900" [D:\Source\sutekishop\Suteki.Shop\packages\NHibernate.188.8.131.5200\lib\NHibernate.dll] to solve conflict and get rid of warning. Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "184.108.40.206" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll] to Version "220.127.116.11" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll] to solve conflict and get rid of warning. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3247: Found conflicts between different versions of the same dependent assembly. Suteki.Shop.CreateDb -> D:\Source\sutekishop\Suteki.Shop\Suteki.Shop.CreateDb\bin\Debug\Suteki.Shop.CreateDb.exe
The problem is that the build output doesn’t tell me which of my assemblies references version 18.104.22.168 of System.Web.Mvc and which references version 22.214.171.124.
If you’re writing software using lots of 3rd party assemblies like I do, it’s a constant problem. I’ve written a little bit of code that I drag around with me that outputs lists of assemblies that my assemblies reference. I’ve found it very useful for resolving these kinds of issues.
Now I’ve wrapped it up as a little console app, AsmSpy, and put it on github here:
Or you can download a zip file of the compiled tool here:
How it works:
Simply run AsmSpy giving it a path to your bin directory (the folder where your project's assemblies live). E.g:
It will output a list of all the assemblies referenced by your assemblies. You can look at the
list to determine where versioining conflicts occur.
The output looks something like this:
.... Reference: System.Runtime.Serialization 126.96.36.199 by Microsoft.ServiceModel.Samples.XmlRpc 188.8.131.52 by Microsoft.Web.Mvc 184.108.40.206 by Suteki.Shop Reference: System.Web.Mvc 220.127.116.11 by Microsoft.Web.Mvc 18.104.22.168 by MvcContrib 22.214.171.124 by MvcContrib.FluentHtml 126.96.36.199 by Suteki.Common 188.8.131.52 by Suteki.Common 184.108.40.206 by Suteki.Shop 220.127.116.11 by Suteki.Shop Reference: System.ServiceModel.Web 18.104.22.168 by Microsoft.Web.Mvc Reference: System.Web.Abstractions 22.214.171.124 by Microsoft.Web.Mvc ....
You can see that System.Web.Mvc is referenced by 7 assemblies in my bin folder. Some reference
version 126.96.36.199 and some version 188.8.131.52. I can now resolve any conflicts.