Assembly versioning

I

Ily

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?
 
P

Prodip Saha

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top