AspNet4YouTop 10sDevelopers WorldForums
Home
About
ASPNet Books
ASPNet Sites
ASPNet Hosters
View Articles
Search Articles
Authors
View Forums
 
Quick Menus
HOME
About
AspNet4You Forums
Articles
Authors
Search
Articles Summary
Articles(RSSFeed)
AspNet Books
AspNet Sites
AspNet Hosters
 Top 10 ASP.NET Books 
Professional ASP.NET 1.1
Essential ASP.NET With Examples in C#
ASP.NET Unleashed
Programming Data Driven Web Applications with ASP.NET
Professional ASP.NET Web Services
Beginning ASP.NET 1.1 with Visual C# .NET 2003
Programming Microsoft ASP.NET
Beginning ASP.NET Databases Using VB.NET
ASP.NET Security
Developing Microsoft ASP.NET Server Controls and Components
More...
 Top 10 ASP.NET Hosters 
WebHost4Life
DiscountASP.NET
MaximumASP
Brinkster
ORCS Web
myhosting.com
ISQSolutions
ASPwebhosting.com, LLC
Active ISP
Aquest Hosting
More...
 Top 10 ASP.NET Sites 
Asp.Net
GotDotNet
4GuysFromRolla.com
123aspx.com
EggHeadCafe.com
CShrp.Net
.NET 247
DevelopersDex.com
Csharp-Corner.com
dotnetspider
More...
Search Articles
Google
ASPNET4YOU      
Category:   Search Type:   Match Type:  
How to redirect an assembly?
Author: Saha, ProdipPosted: 5/3/2005 8:15:12 PM

How to redirect an assembly?

There may be a time when you want to use a different version of the same assembly from the compiled version. This article assumed that multiple versions of the same assembly already installed in the GAC. You can redirect the assembly to another version at runtime through publisher policy file such as web.config or app.config at the application level. Add the following section in your application configuration file to redirect the as assembly-

<configuration>

...Other section goes here

<runtime>

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

            <publisherPolicy apply="no"/>

            <dependentAssembly>

                  <assemblyIdentity name="Your-component-name-in-gac"
publicKeyToken="afe57206630e1asd" culture="neutral" />

                  <bindingRedirect oldVersion="1.0.1010.12345"
newVersion="1.0.1010.67890"/>

            </dependentAssembly>

            <dependentAssembly>

                  <assemblyIdentity name="Your-component-name-in-gac"
publicKeyToken="afe57206630e1asd" culture="neutral" />

                  <bindingRedirect oldVersion="1.0.1010.12345"
newVersion="1.0.1010.67890"/>

            </dependentAssembly>

    </assemblyBinding>

</runtime>

</configuration>
					

The runtime tags goes outside the system.web tags. Also, you must specify the correct culture and publickeytoken. Otherwise, redirections will not work. Be sure to use PublisherPolicy tag in web.config to override the default behavior.


Prodip K. Saha
The Architect of WWW.ASPNET4YOU.COM.

Terms and Conditions