Over the last year or so I have been working predominantly with ASP.NET and for that reason alone I have tended to not have to deal directly with the GAC and some of its finer benefits (specifically side by side execution). So I thought I would go over one of the benefits of bindingRedirect.

Obviously the prerequisite to installing assemblies in the GAC include creating strong name key file, associating it with the assembly and installing it in the GAC, and so I created two version of an assembly.


In my test application I configured and tested against, and so based on that fact, the test application would call . In order to ensure that I can use version 1.2 at will  I needed to create and\or modify the App.Config file to use the bindingRedirect element as follows.

            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                            <assemblyIdentity name="TestLib"  /> 
                            <bindingRedirect oldVersion="" newVersion=""/>

If you are dealing with multiple applications that need to be upgraded, or indeed downgraded, you should also consider using a Publisher Policy File or modifying the Machine Config File.

Comment Section

Comments are closed.