468,306 Members | 1,243 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,306 developers. It's quick & easy.

Assembly versioning

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?

Nov 19 '05 #1
2 1481
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?

Nov 19 '05 #2
The other option to chaning each config file for each application is to use
a publisher policy, which is a single configuration file (really an assembly
installed into the GAC). This makes it easier (configuration-wise) to have
every app using your component load the one you've specified. Here are some
docs:

http://msdn.microsoft.com/library/de...PolicyFile.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen
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?


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Henrik Skak Pedersen | last post: by
5 posts views Thread by mekim | last post: by
10 posts views Thread by jojobar | last post: by
11 posts views Thread by Just Me | last post: by
6 posts views Thread by Nak | last post: by
6 posts views Thread by Gavin Sullivan | last post: by
6 posts views Thread by Ben | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.