Monday, August 09, 2004

VJs Tip Of The Day - August 9th 2004

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 publickeytoken="whatever" name="SomeAssembly">
<publisherpolicy apply="no">
<bindingredirect newversion="1.0.2.0" oldversion="1.0.1.1">
</dependantassembly>
</assemblybinding>
</runtime>
</configuration>


PS: You can achieve the same with different methods as well this is just one of them

No comments: