Dependent Assembly Binding Redirect (by version)

Adopted for Addins from Suzanne Cook's .NET CLR Notes

By default, the application configuration file of the default appdomain, is in the process exe’s directory, and named the same as the process exe + ".config". Application configuration files are per-appdomain. So, you can set a ‘dll config’ for your addin by using the same method, but that means that it will be used for the entire appdomain, and it only gets one. With this approach the addin, can also use its own config settings internally (see code example link below).

Redirects “assemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=25283151a234958d“ to version 2.0.0.0 of that assembly. This is only useful for strongly-named assemblies, since versions don't matter for those that are simply-named.


<?xml version ="1.0"?>
<configuration>
<runtime>

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

                <dependentAssembly>
                        <assemblyIdentity name="assemblyName" culture="" publicKeyToken="25283151a234958d"/>
                        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>

                </dependentAssembly>
        </assemblyBinding>

</runtime>
</configuration>

See Jeffrey Palermo's blog for code example

 


Posted Feb 08 2007, 03:45 PM by Gary
Filed under:
Copyright Summit Software Company, 2008. All rights reserved.