.net – changing a dll manifest

dllnet

I got a complete vs2005 project from our sub-contractor, which depends on several of their other projects. I didn't get those projects' source files, but I do have their dlls in the bin/debug folder (lets call them a.dll and b.dll).
I copied those dlls into a \lib folder, and changed the references to point there. The problem I have now is that a.dll and b.dll depend on a specific version of a product we are developing upon, and our system here has a different version installed.

Is there a simple enough way to open a.dll and b.dll and change their manifest to target our version of the product? Or better yet – make them not depending on a specific version?

Best Answer

Can you use Assembly Binding Redirection to make the required versions actually load the versions you've got?

e.g. in your app.settings file, have something like this:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="myAssembly"
                          publicKeyToken="32ab4ba45e0a69a1"
                          culture="en-us" />
        <bindingRedirect oldVersion="1.0.0.0"
                         newVersion="2.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
Related Topic