How to redirect an assembly?
There may be a time when you want to use a different assembly version from
the compiled version. You can redirect the assembly to another version at
runtime through publisher policy file such as web.config. Add the following
section in your application configuration file to redirect the data access
components.
<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.
Thanks,
Prodip
www.aspnet4you.com
"Ily" <il***@igsoftwaresolutions.co.uk> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Hi
I have several versions of an assembly in the GAC
My problem is that I want my clients (windows + web clients) to use a
specific version of an assembly
I can get this to work by using the <assemblyBinding> tag in the
app.config
However for web applications, you cant use the <assemblyBinding> as it
is not supported, instead you have to use <assemblies> tag.
This does not work!
I n my web application I have a reference to a GAC dll and this is what
always gets used. However I want to specify a different version using
the web.config, but this doesnt seem to work
Any ideas suggestions anyone?