Wednesday, August 11, 2004

Changing Reference to different version of external assembly










Changing Reference to different version of external assembly

Consider a scenario when your application is referencing version 1.0.1.1 of
"SomeAssembly" in GAC... Now you realize that there are some major bugs in
that assembly and you want your assembly to reference the new version of the
assembly (say 1.0.2.0) and you do not want to go ahead and recompile your
code for that... What would you do... Well here is the answer... You would
go and change the configuration file with similar updates to the ones I am
writing below...

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asmv1">
<publisherPolicy apply="no"/>
<dependantAssembly>
<assemblyIdentity name="SomeAssembly"
publicKeyToken="whatever" />
<publisherPolicy apply="no"/>
<bindingRedirect oldVersion="1.0.1.1"
newVersion="1.0.2.0" />
</dependantAssembly>
</assemblyBinding>
</runtime>
</configuration>
Regards,
Mitesh v. Mehta

No comments: