none
Found conflicts between different versions of the same dependent assembly.

    Question

  • Is there an easy way to determine which assembly or assemblies are conflicting?

    When I double-click on the error message in the Error List panel, a message box pops up and says:

    One or more dependent assemblies have version conflicts.  Do you want to fix these conflicts by adding binding redirect records in the app.config file?

    Under what circumstances would I want to do that?  And what are the alternatives?

    Friday, May 26, 2006 7:49 PM

Answers

  • Use ildasm.exe to look at the manifests in your app and assemblies. The offending dependencies should be obvious if you don't have too many assemblies.

    If you have the option of recompiling the app (and/or assemblies) to have consistent references, do so.

    If you don't have any compatibility, deployment or security concerns about the particular assembly versions, a binding redirect is fine.

    Tuesday, June 06, 2006 1:35 AM
  • This means that all assembly binding references for versions 0.0.0.0-8.0.11.194 of that assembly will be modified to request version 8.0.11.194 for that application. You can't load multiple versions of the same assembly in the same app domain, so without this binding redirect, an attempt to load a different version of an already loaded assembly will fail.

    You don't need the binding redirect if the assembly in question is weakly named (i.e. the publickey/publickeytoken is null) or if your assembly references are consistent (i.e. all ask for the same version). Aside from recompiling the assemblies to have the same version dependencies, there's nothing else you can do if you don't have the source.

    Thursday, August 24, 2006 11:16 PM

All replies

  • Use ildasm.exe to look at the manifests in your app and assemblies. The offending dependencies should be obvious if you don't have too many assemblies.

    If you have the option of recompiling the app (and/or assemblies) to have consistent references, do so.

    If you don't have any compatibility, deployment or security concerns about the particular assembly versions, a binding redirect is fine.

    Tuesday, June 06, 2006 1:35 AM
  • My binding redirect statement looks like this

    <bindingRedirect oldVersion="0.0.0.0-8.0.11.194" newVersion="8.0.11.194"/>

    What does this really mean? What else could I have done to fix this other than allowing the binding redirect?

    Monday, August 21, 2006 5:39 PM
  • This means that all assembly binding references for versions 0.0.0.0-8.0.11.194 of that assembly will be modified to request version 8.0.11.194 for that application. You can't load multiple versions of the same assembly in the same app domain, so without this binding redirect, an attempt to load a different version of an already loaded assembly will fail.

    You don't need the binding redirect if the assembly in question is weakly named (i.e. the publickey/publickeytoken is null) or if your assembly references are consistent (i.e. all ask for the same version). Aside from recompiling the assemblies to have the same version dependencies, there's nothing else you can do if you don't have the source.

    Thursday, August 24, 2006 11:16 PM
  • Thank you for your explanation.

    The project was a VB.NET 2003 which I pulled into VB.NET 2005 Express.

    I tried deleting the reference to the old assembly and then adding a reference to the current assembly, but that still did not work. Why isn't this enough?

    I don't want to have to use an app.config file. What can I do to "update" the project to reference the newest assembly?

    In VB6, all I had to do was add a reference to what I wanted to my project file.

    As you can probably tell, I am newbie at this.


    Friday, August 25, 2006 3:44 PM
  • It should be sufficient to remove the old reference and then add the new updated one, then rebuild. Check all your dependencies' dependencies to see if there is still a reference to the old version of that assembly somewhere.
    Friday, August 25, 2006 8:20 PM
  • OK, I had this message on a relatively simple assembly (not a whole lot of references).  I would build, see this warning, double-click, and answer Yes to fix the problem.  Next time I build, it reappered.

    In order to correct this, what I eventually did was to edit the XML in the project's app.config, remove the "dependentassembly" keys from the AssemblyBinding section, then when I rebuild, and double-click and answer Yes to fix the problem, it really does fix it.  I watched the app.config and saw the entry for the conflicting assembly get added.
    Monday, March 10, 2008 7:23 PM
  • My solution to the same problem was the following:

    • - Double click in the Solution Explorer on 'My Project'
    • - Click the 'References'-tab at the left
    • - Click the 'Unused references...'-button (right top), a list of unused references appears in a new box that opens
    • - Click the 'Remove'-button.

    Now rebuild your project and your problem is gone.
    • Proposed as answer by Coolwine Wednesday, September 08, 2010 8:45 PM
    Wednesday, August 06, 2008 9:29 AM
  • My solution to the same problem was the following:

    • - Double click in the Solution Explorer on 'My Project'
    • - Click the 'References'-tab at the left
    • - Click the 'Unused references...'-button (right top), a list of unused references appears in a new box that opens
    • - Click the 'Remove'-button.

    Now rebuild your project and your problem is gone.
    Thats awesome! Best reply ever. Totally fixed my problem
    • Proposed as answer by cjan Wednesday, October 21, 2009 9:38 AM
    Sunday, April 05, 2009 7:35 AM
  • Hi,

    we are getting also the warning MSB3247: Found conflicts between different versions of the same dependent assembly. In relation with the compile message "Consider app.config remapping of assembly "XYZ, Culture=neutral, PublicKeyToken=08154711" from Version "1.0.0.0" [] to Version "2.10.28.1" [pathToAssembly\XYZ.dll] to solve conflict and get rid of warning."

    I have full sourcecode and recompile does not fix it!

    Which Visualstudio Version do yo use?
    I'm working with VS 2005 Prof. in C# .Net 2.0, but there are no such button "Unused references..."! ?

    plz help
    Wednesday, December 09, 2009 9:05 AM
  • Here is a utility to help identify the offending reference(s):

    http://www.brianlow.com/index.php/2010/01/25/find-conflicting-assembly-references/

    Tuesday, January 26, 2010 6:00 AM
  • I am trying to do the above vs 2010, c#, and its not working out...don't see things here as you mention

    them..I don't see 'Unused references..-button(right top), but I do have this same error message though,

    does anyone have an explanation for this..I am following the steps, Thanks

    Monday, October 04, 2010 5:33 PM
  • I am using VS C# and this appears to be an example regarding visual BASIC.NET ..I am

    using VS 4.0 c# and wish i knew how to do like above..anyone have a solution? thanks

    Monday, October 04, 2010 5:38 PM
  • This is over a year later but if anyone still needs a slightly different answer...

    If you just suddenly got the "...conflicts between different versions of the same dependent assembly..." as a warning in your error list -AFTER having just added a new reference to one of your projects in your solution, what most likely just happened if you've got the newest version of the reference installed in that project of your solution. The thing is elsewhere in a different project of that solution a different reference may have installed the older version previously. The easiest fix is to download the NuGet Package manager if you don't already use it, and then for each of your projects in your solution: right-click the project top-level, select Manage NuGet Packages.  When it loads, find the "Updates" button (currently it's on the left of the popup) and press it. If it says no package updates are avaliable, you're good. Do this for all of your projects in your solution. In one of them, it WILL have the ability to upgrade your offending dependent assembly. Then do it. Problem solved.

    Here's a concrete example: when you add a new MVC3 project to your solution, it will also load the Entity Framework package, like 4.1.10331.0. If you then use NuGet to add in the Entity Framework package to say, a class library project that models your domain, NuGet will give you the newer Entity Framework package 4.2.0.0 . Now you've got your conflict. Do as the paragraph above said, and you'll solve it.



    • Proposed as answer by T.K.Cardozo Friday, December 30, 2011 8:37 AM
    • Edited by T.K.Cardozo Saturday, January 07, 2012 6:16 AM correction to the example
    Friday, December 30, 2011 2:13 AM
  • My solution to the same problem was the following:

    • - Double click in the Solution Explorer on 'My Project'
    • - Click the 'References'-tab at the left
    • - Click the 'Unused references...'-button (right top), a list of unused references appears in a new box that opens
    • - Click the 'Remove'-button.

    Now rebuild your project and your problem is gone.
    Well, someone thinks your answer is awesome, I don't understand what you are talking about! double click on solution explorer in where? Visual Studio? Reference Tab? where is it?
    Wednesday, January 18, 2012 3:41 AM
  • BobSort and the rest,

    The solution proposed by Jan-Dirk works great!

    I reordered the words from the original message from Jan-Drik, to make the instructions more clear:

    Double click on 'My Project', in the Solution Explorer window

    Then follow the other steps and you are set.

    Saturday, April 14, 2012 7:29 PM
  • Hey thanks, that worked perfectly for me too :)

    Friday, August 02, 2013 7:15 AM