Publisher Policy

G

Guest

I need help understanding how to upgrade an assembly in the GAC.

If I have 1.0.0.0 installed in the GAC. And I have just compiled 1.1.0.0,
but have not put it into the cache. How do I make all assemblies using
1.0.0.0, use 1.1.0.0, without modifying their assembly references.

I have created a publisher policy config file. What step do I do next?

? Add the v1.1.0.0 component to the GAC
? Compile the publisher policy config file using AL.EXE, and add to GAC


Thanks for your help.
 
M

Mattias Sjögren

Mike,
I have created a publisher policy config file. What step do I do next?

? Add the v1.1.0.0 component to the GAC
? Compile the publisher policy config file using AL.EXE, and add to GAC


Both, and I don't think the order matters.



Mattias
 
S

Steven Cheng[MSFT]

Hi Mike,

As for the redirecting different version of assembly without moidifying the
assembly reference in the caller application, this is the by default
behavior of the .net assembly binding's BindRedirection feature.
This is done by the <bindingRedirect> element under the <assemblyBinding>
element in your configuration file:

#assemblyBinding> Element
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht
ml/gngrfAssemblyBinding.asp

In fact, this setting is configurable at three level:

Application Policy -------> Publisher Policy --------> Machine Policy

So we can also use the app.config or machine.config in addition to the
component level(Publisher policy) setting. For example: giving the
following setting:

<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>

When the application is trying to load the "myAssembly" that match the
identity in the above
<assemblyIdentity> it will redirect the reference to 2.0 version is the
application used to reference 1.0

This is done at runtime without changing the original assembly reference.

HTH. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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