PC Review


Reply
Thread Tools Rate Thread

Detecting GAC assembly in use during uninstallation

 
 
Drew Liscomb
Guest
Posts: n/a
 
      7th Jan 2004
Fellow Frameworkers,

Our developer tools are a set of assemblies installed in
the GAC. I use InstallShield 8.0 to create an MSI-based
installer that installs the assemblies just fine, thanks.

My problem is that on uninstallation, an assembly
currently in use by a running application (IIS, for
example) is not detected. Instead, the uninstallation
seems to complete successfully, but the assembly in use is
left in the GAC.

I want to prevent uninstallation, or at least alert the
user if any of the assemblies is in use. How can I detect
a GAC assembly in use?

BTW, I tried searching (with another search engine) this
group for "uninstall assembly GAC" and the phrase "in use"
but the one hit was irrelevant. Also, I originally posted
in platformsdk.msi, and was directed here.

Drew Liscomb
Installer Engineer
MapInfo Corporation
 
Reply With Quote
 
 
 
 
Felix Wang
Guest
Posts: n/a
 
      8th Jan 2004
Hello Drew,

Thanks for posting. I am still working on this issue and trying to
reproduce the situation. I am not sure how to make an assembly in GAC "in
use by another application". Could you kindly let me know your detailed
steps?

In my ASP.Net web application, I make reference to a class library assembly
in the GAC. To achieve this, I have to make reference to the same class
library outside GAC (with "Copy Local" set to false) to build and then
remove it. In my ASP.Net page, I add a button and use the very simple code
like the following:

private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write(new ClassLibrary9.Class1().Hello());
}

I close the IDE and open the page
"http://localhost/webapplication1/webform1.aspx" in IE. If I click the
button, a string value will be written to the page. Then I use the "gacutil
/u ClassLibrary9" command and attempt to remove the assembly from the GAC.
The command completes successfully and the assembly is removed. On the
other hand, the ASP.Net page is still working.

It seems that the application has loaded the assembly into the AppDomain
and does not hold the lock against the physical assembly in GAC. (The
shadow copy mechanism does not apply to assemblies in GAC.) Then I use
"iisreset" to restart the services and the web application no longer works.

I have repeated the test by installing the assembly into GAC via a MSI. The
same thing happens. I can remove the assembly with the uninstallation of
the MSI. The ASP.Net application can work without a physical copy of the
assembly for a while.

Is there anything wrong with my steps? I believe that we will be more
helpful if we can reproduce your situation. I look forward to hearing from
you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembly version detecting utility? Martin Hart Microsoft Dot NET Framework 5 26th Nov 2007 06:34 PM
Monitoring / detecting assembly calls =?Utf-8?B?RXJpYw==?= Microsoft Dot NET Framework 4 30th Mar 2006 08:11 PM
Problem during uninstallation of assembly from GAC rkj Microsoft Dot NET Framework 1 26th Jul 2005 05:27 PM
Detecting assembly changes Chris Dunaway Microsoft Dot NET 2 28th Mar 2005 07:41 PM
Detecting a dll type (.NET Assembly or not) George Straw Microsoft Dot NET Framework 1 18th Sep 2003 02:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:43 AM.