Search:
Namespaces
Discussions
.NET v1.1
Feedback
NOT ANSWERED BEFORE: Updating Assemblies in GAC
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngescalate' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Little, Ambrose
I tried this question in aspngfreeforall and got no answers. Hoping someone
here can help.
I recently made changes to a shared assembly in the GAC on one of our
servers. I did this by going to \WINNT\assembly and deleting the current
version and then dragging and droping the new version into it (same way I
installed it the first time). (Note: when I say "version" I don't mean
literal version.. it has the same major/minor version, build, revision.) I
don't want to change the version numbers because then I'd have to update all
of the consuming applications to use the new version.
First off, it appeared that it did not recognize the new assembly, and I had
to restart IIS to get it to recognize it. Then it told me that the
particular method that I modified was not found. I figured that this might
have something to do with some sort of compiled signature in the consuming
DLL, so I removed the reference from the consumer and added it again and
recompiled, and then it started working.
So, my questions are:
1) Is it normal to have to restart IIS in order to get a modified version of
a GAC assembly to be recognized by the consuming applications?
2) Did I do something wrong on the update? Is there a better (more correct)
way to update a GAC assembly?
3) Should I have to recompile my consuming applications? Or is it only
necessary when you change the signature of previously used methods? (Note:
I only added an optional paramter to the method in question, but I'm
guessing that it doesn't matter if it's optional or not--it still changes
the signature, no?)
Thanks!
--Ambrose
Reply to this message...
Andy Smith
I could be wrong, but it seems you are going against the whole point of the GAC.
The GAC was designed so you would have different versions of the same component, BECAUSE they were strongly named.
And if an application loaded a component from the GAC, it did so with its strong name, expecting that same item.
I suggest you do your testing with a weak reference, and when you are sure it's done, THEN move it to the GAC
____________
Andy Smith
Chief Code Monkey
-----Original Message-----
From: Little, Ambrose [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, February 28, 2002 2:06 PM
To: aspngescalate
Subject: [aspngescalate] NOT ANSWERED BEFORE: Updating Assemblies in GAC
I tried this question in aspngfreeforall and got no answers. Hoping someone here can help.
I recently made changes to a shared assembly in the GAC on one of our servers. I did this by going to \WINNT\assembly and deleting the current version and then dragging and droping the new version into it (same way I installed it the first time). (Note: when I say "version" I don't mean literal version.. it has the same major/minor version, build, revision.) I don't want to change the version numbers because then I'd have to update all of the consuming applications to use the new version.
First off, it appeared that it did not recognize the new assembly, and I had to restart IIS to get it to recognize it. Then it told me that the particular method that I modified was not found. I figured that this might have something to do with some sort of compiled signature in the consuming DLL, so I removed the reference from the consumer and added it again and recompiled, and then it started working.
So, my questions are:
1) Is it normal to have to restart IIS in order to get a modified version of a GAC assembly to be recognized by the consuming applications?
2) Did I do something wrong on the update? Is there a better (more correct) way to update a GAC assembly?
3) Should I have to recompile my consuming applications? Or is it only necessary when you change the signature of previously used methods? (Note: I only added an optional paramter to the method in question, but I'm guessing that it doesn't matter if it's optional or not--it still changes the signature, no?)
Thanks!
--Ambrose
| [aspngescalate] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/aspngescalate.asp
= JOIN/QUIT
Reply to this message...
Mitch Denny (VIP)
Ambrose,
If you haven't done so already I highly recommend that you
read the "How the Runtime Locates Assemblies" section in
the Framework SDK documentation, here is the ms-help URL:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconhowruntimelocatesassemb
lies.htm
There is also this miscellaneous information on assembly
versioning that is worth a read:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconassemblyversionredirect
ion.htm
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconassemblyversioning.htm
That last one explicitly states that versioning based on
assembly version is only applied on strongly-named assemblies,
and this applies to your situation.
From the description of what you are seeing it looks like
you have inadvertantly modified the method signatures on
some of your classes which would explain the runtime throwing
when it couldn't find the method. The fact that you got
that far means that it accepted the version of the assembly
in the GAC as legitimate.
In this case you just need to be more careful with
how you treat your classes. If you are going to be
using the GAC extensively I'd recommend adopting a
program by contract paradigm where at release your
interfaces get set in stone and if you want to change
the method signature then you have to implement a
new interface on the class.
As Andy suggested, make use of the GAC facility for
side-by-side registration of assemblies, it is very
very useful sometimes. And when you want to force a
client to a new version of an assembly without recompiling
put in a policy file (documentation referenced above).
Hopefully between the documentation and my fairly
lame description you know how to proceed, if you still
aren't sure what to do post back.
--------------------------------------
- Mitch Denny
-
Click here to reveal e-mail address
- +61 (414) 610-141
-
-----Original Message-----
From: Little, Ambrose [mailto:
Click here to reveal e-mail address
]
Sent: Friday, 1 March 2002 08:49
To: aspngescalate
Subject: [aspngescalate] RE: NOT ANSWERED BEFORE: Updating Assemblies in
GAC
I don't really consider this an answer. Thanks for your opinion on my
methods, though. Side-by-side versioning is only part of the vision for
the GAC, not the whole point.
--Ambrose
-----Original Message-----
From: Andy Smith [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, 28 February, 2002 15:24
To: aspngescalate
Subject: [aspngescalate] RE: NOT ANSWERED BEFORE: Updating Assemblies in
GAC
I could be wrong, but it seems you are going against the whole point of
the GAC.
The GAC was designed so you would have different versions of the same
component, BECAUSE they were strongly named.
And if an application loaded a component from the GAC, it did so with
its strong name, expecting that same item.
I suggest you do your testing with a weak reference, and when you are
sure it's done, THEN move it to the GAC
____________
Andy Smith
Chief Code Monkey
-----Original Message-----
From: Little, Ambrose [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, February 28, 2002 2:06 PM
To: aspngescalate
Subject: [aspngescalate] NOT ANSWERED BEFORE: Updating Assemblies in GAC
I tried this question in aspngfreeforall and got no answers. Hoping
someone here can help.
I recently made changes to a shared assembly in the GAC on one of our
servers. I did this by going to \WINNT\assembly and deleting the
current version and then dragging and droping the new version into it
(same way I installed it the first time). (Note: when I say "version" I
don't mean literal version.. it has the same major/minor version, build,
revision.) I don't want to change the version numbers because then I'd
have to update all of the consuming applications to use the new version.
First off, it appeared that it did not recognize the new assembly, and I
had to restart IIS to get it to recognize it. Then it told me that the
particular method that I modified was not found. I figured that this
might have something to do with some sort of compiled signature in the
consuming DLL, so I removed the reference from the consumer and added it
again and recompiled, and then it started working.
So, my questions are:
1) Is it normal to have to restart IIS in order to get a modified
version of a GAC assembly to be recognized by the consuming
applications?
2) Did I do something wrong on the update? Is there a better (more
correct) way to update a GAC assembly?
3) Should I have to recompile my consuming applications? Or is it only
necessary when you change the signature of previously used methods?
(Note: I only added an optional paramter to the method in question, but
I'm guessing that it doesn't matter if it's optional or not--it still
changes the signature, no?)
Thanks!
--Ambrose
| [aspngescalate] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/aspngescalate.asp
= JOIN/QUIT
| [aspngescalate] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/aspngescalate.asp
= JOIN/QUIT
| [aspngescalate] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/aspngescalate.asp
= JOIN/QUIT
Reply to this message...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com