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:

Comments

nitinumap wrote re: Dependent Assembly Binding Redirect (by version)
on 06-08-2010 9:35 AM

We used same mechanism for assembly binding redirect. It worked fine till VS2005. Recently our product development migrated to VS2008 SP1. After that VSTA addins stoped loading. It always searches for the assembly with which it was built. Any solution to this problem.

FYI - If I configure policy using control pane->admin tools then it works fine.

Melody wrote re: Dependent Assembly Binding Redirect (by version)
on 07-27-2010 12:34 PM

Please see this blog for a resolution:  www.summsoft.com/.../binding-redirects.aspx

Dependent assembly | Ballocapesso wrote Dependent assembly | Ballocapesso
on 02-19-2012 2:06 PM

Pingback from  Dependent assembly | Ballocapesso

Copyright Summit Software Company, 2008. All rights reserved.