How to upgrade a GAC'ed dll

G

Guest

Hi all

I'm building an application that contains a dll that will be used by several
other applications.
The dll is installed in the GAC, to make it easy for everyone to find it.
When my application is upgraded, I'm also installing a policy in the GAC so
any call to the old dll is redirected to the new one.


My problem is the following scenario;


1) My.dll 1.0.0.0 is installed in the GAC

2) My.dll is upgraded to 1.1.0.0 (replaces the previous version in the GAC)
policy.1.0.My.dll is installed in the GAC, redirecting 1.0.0.0 to 1.1.0.0

3) My.dll is upgraded to 1.2.0.0 (replaces the previous version in the GAC)
policy.1.1.My.dll is installed in the GAC, redirecting 1.1.0.0 to 1.2.0.0



After step 3, when an application is trying to use My.dll version 1.0.0.0,
it only gets redirected to My.dll version 1.1.0.0 and not to 1.2.0.0 which I
wanted.


Isn't it possible to use version redirection multiple steps?
Do I need to add a new policy AND update my old policys everytime I upgrade
the dll?

Thanks!
/Fredrik
 
M

Michael Nemtsev, MVP

Hello Fredrik,

Did u provide the publisher policy with your new assemblies? http://msdn2.microsoft.com/en-us/library/7wd6ex19(vs.71).aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


FP> Hi all
FP>
FP> I'm building an application that contains a dll that will be used by
FP> several
FP> other applications.
FP> The dll is installed in the GAC, to make it easy for everyone to
FP> find it.
FP> When my application is upgraded, I'm also installing a policy in the
FP> GAC so
FP> any call to the old dll is redirected to the new one.
FP> My problem is the following scenario;
FP>
FP> 1) My.dll 1.0.0.0 is installed in the GAC
FP>
FP> 2) My.dll is upgraded to 1.1.0.0 (replaces the previous version in
FP> the GAC)
FP> policy.1.0.My.dll is installed in the GAC, redirecting 1.0.0.0 to
FP> 1.1.0.0
FP> 3) My.dll is upgraded to 1.2.0.0 (replaces the previous version in
FP> the GAC)
FP> policy.1.1.My.dll is installed in the GAC, redirecting 1.1.0.0 to
FP> 1.2.0.0
FP> After step 3, when an application is trying to use My.dll version
FP> 1.0.0.0, it only gets redirected to My.dll version 1.1.0.0 and not
FP> to 1.2.0.0 which I wanted.
FP>
FP> Isn't it possible to use version redirection multiple steps?
FP> Do I need to add a new policy AND update my old policys everytime I
FP> upgrade
FP> the dll?
FP> Thanks!
FP> /Fredri
 
G

Guest

Hi Michael

Yes, (at least) one publisher policy is included with the assembly.
I'm creating a msi using WiX, which installs my application, registers the
dll in the GAC and finally registers the publisher policy in the GAC.

What bugs me is that it seems that I need to include one policy-dll for each
major.minor-version that has been released earlier, when I'm creating a new
msi.

/Fredrik
 
M

Michael Nemtsev, MVP

Hello Fredrik,

Yep, it is.
when u publish the new version it's better to provide the new published policy
for this
or update existed with the new redirection

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


FP> What bugs me is that it seems that I need to include one policy-dll
FP> for each major.minor-version that has been released earlier, when
FP> I'm creating a new msi.
FP>
 

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