GAC question: Will a newer version be used for an application?

G

Guest

I found several articles about GAC, but none of them can answer my question
(perhaps I am reading too fast :)).

Suppose I have an application that is built against a shared assembly
version 1.0. That asembly is installed to GAC. Later a newer version of the
shared assembly is installed, say 1.1.

I want to know:

1. If the runtime will automatically select the newer version for the
application (not rebuilt).

2. Or do I need to rebuild it in order to use the newer version.

Thanks.
 
R

Richard Blewett [DevelopMentor]

1. No, will always unless instructed otherwise attempt to load the version the app was built against

2. You do not need to recompile to upgrade too the newer version

You are looking for the feature known as Version Redirection. You turn it on using configuration files which can be configured either at Application level (the app config file) publisher (the author of the shared component ships a version policy signed with the same key pair as the assembly - see Publisher Policy) or machine (configured in machine.config).

It is controlled by the <bindingRedirect> element in the config file which is under the <dependantAssembly> element

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I found several articles about GAC, but none of them can answer my question
(perhaps I am reading too fast :)).

Suppose I have an application that is built against a shared assembly
version 1.0. That asembly is installed to GAC. Later a newer version of the
shared assembly is installed, say 1.1.

I want to know:

1. If the runtime will automatically select the newer version for the
application (not rebuilt).

2. Or do I need to rebuild it in order to use the newer version.

Thanks.
 
A

Arniec

I am interested in this, too. If I want to propagate an update of a shared
assembly to several previously compiled projects, how do i do this? Is this
what you are speaking about. Where can I read about it if it is?

Many thanks
 

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

Top