Loading dll of same assembly name RRS feed

  • Question

  • In my application, I have two assemblies(third party) of different versions , publickeytoken but same assembly name in different app paths. For some of my projects the lower version of that dll is required and for some other higher version of that dll is needed. I have referred these two dll where ever it is needed. While compiling it doesn't throw any error. But in runtime i'm getting the following exception
        "Could not load file or assembly 'AssemblyName, Version=x.x.x.x, Culture=neutral, PublicKeyToken=xxxxxxx' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
    Is there any way to load assembly by considering all four parameters?
    Tuesday, April 21, 2015 7:57 AM

All replies

  • You're not giving near enough information. What does this mean -- "I have referred these two dll where ever it is needed"? What runtime version are we talking about? What VS version? Are these assemblies in the GAC? Are you just letting the build and 'shadow copy' copy referenced outputs into the solution folder (in which case one is probably overwriting the other)?

    Fusion Log Viewer is the tool you should start with to resolve binding issues.

    Wednesday, April 22, 2015 12:47 AM
  • Steve,

         For your questions,

    Few functionality are not available in the higher version which were in lower version of that assembly, i mean to say i cant redirect lower version assembly to higher version<bindingRedirect>.

    I'm using VS2010 Professional version.

    None of these assemblies are in GAC.

    These dll's are not in same path.For example A(v2.0) is in app path and A(v1.0) is in app path\Assmebly. It doesnt override one another.

    Please let me know if u need more information



    Wednesday, April 22, 2015 7:59 AM
  • Fusion log traces are the next logical step.
    Friday, April 24, 2015 12:05 AM