Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Can't delete an assembly from the GAC!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Juan Dent - 02 Aug 2005 16:51 GMT
Hi,

I need to delete an assembly from the GAC but it tells me

"Can not acces file 'IDODBLibNET' because it is being used by another process"

Now, I have deleted the assemblies that I know depend on this one. I can't
remember any other.

Is there a list of dependencies somewhere so that I can see which assembly
is depending on the one I need to delete?

Signature

Thanks in advance,

Juan Dent, M.Sc.

Derrick - 02 Aug 2005 16:57 GMT
How are you deleting it?  I've had issues when doing it from Windows
Explorer, so I only do it from the command line now.

Derrick

> Hi,
>
[quoted text clipped - 8 lines]
> Is there a list of dependencies somewhere so that I can see which assembly
> is depending on the one I need to delete?
Juan Dent - 02 Aug 2005 18:37 GMT
Yes I am using the Windows Explorer. However I don't think its going to
change anything to do it in command line since I also tried deleting it
through the .NET Configuration 1.1.

Anyway, even if it could be done by cmd line, the other part of my question
still holds: how can we find out which other applications depend on one given
assembly?

Signature

Thanks in advance,

Juan Dent, M.Sc.

> How are you deleting it?  I've had issues when doing it from Windows
> Explorer, so I only do it from the command line now.
[quoted text clipped - 13 lines]
> > Is there a list of dependencies somewhere so that I can see which assembly
> > is depending on the one I need to delete?
Nicolas Guinet - 02 Aug 2005 19:06 GMT
Hi,

Did you try to examin the manifest of your assembly with ildasm.exe ?
All referenced assemblies are indicated in lines

".assembly extern ....REFERENCE ASSEMBLIES HERE...."

Nicolas Guinet

> Hi,
>
[quoted text clipped - 8 lines]
> Is there a list of dependencies somewhere so that I can see which assembly
> is depending on the one I need to delete?
Juan Dent - 02 Aug 2005 21:06 GMT
Looking at the manifest of the assembly I am not able to delete from the GAC
will not help. It will tell me its dependencies but not who else depends on
it.

No, there must be someway to find out when an assembly states that another
one uses it, to find out who it is referring to..

Signature

Thanks in advance,

Juan Dent, M.Sc.

> Hi,
>
[quoted text clipped - 17 lines]
> > Is there a list of dependencies somewhere so that I can see which assembly
> > is depending on the one I need to delete?
Nicole Calinoiu - 02 Aug 2005 21:42 GMT
To list references:
   gacutil /lr <assembly name>

To force removal from the GAC despite the references:
   gacutil /uf <assembly name>

For more informtion on gacutil, see
http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfGlobalAssemblyCacheUti
lityGacutilexe.asp
.

> Looking at the manifest of the assembly I am not able to delete from the
> GAC
[quoted text clipped - 28 lines]
>> > assembly
>> > is depending on the one I need to delete?
Juan Dent - 03 Aug 2005 01:05 GMT
"To list references:
   gacutil /lr <assembly name>"

Does nothing but display the complete assemly name (public token, etc).

There must be a tool for what I want.

Signature

Thanks in advance,

Juan Dent, M.Sc.

> To list references:
>     gacutil /lr <assembly name>
[quoted text clipped - 37 lines]
> >> > assembly
> >> > is depending on the one I need to delete?
"Peter Huang" [MSFT] - 03 Aug 2005 03:23 GMT
Hi

Because the DLL itself will not record who will load it, it may be used by
many processes.
I think you may try to use the tool below to find what DLL certain
processes have.
ListDlls
http://www.sysinternals.com/Utilities/ListDlls.html
Process Explorer(GUI)
http://www.sysinternals.com/Utilities/ProcessExplorer.html

e.g. Use Ctrl+E and input Dll name.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

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

Nicole Calinoiu - 03 Aug 2005 12:27 GMT
The fact that you're seeing only the assembly name means that no
applications have registered their references to this GACed assembly using
the tools provided for this purpose.  Given this, you will need to track
down the referencing assembly on your own.  If the assembly is actually
running, the SysInternals ProcessExplorer tool that Peter mentioned should
help with this.  However, it may also be that the DLL file is simply locked
as an open file rather than as executing code, so you might want to try
FileMon (http://www.sysinternals.com/Utilities/Filemon.html) if you can't
find a process that's running your assembly.

> "To list references:
>    gacutil /lr <assembly name>"
[quoted text clipped - 48 lines]
>> >> > assembly
>> >> > is depending on the one I need to delete?
Juan Dent - 03 Aug 2005 18:45 GMT
Hi and thanks. Just one question:

How does one register that a certain assembly depends on another? As in your
comment:

> applications have registered their references to this GACed assembly using
> the tools provided for this purpose.  Given this, you will need to track

Signature

Thanks in advance,

Juan Dent, M.Sc.

> The fact that you're seeing only the assembly name means that no
> applications have registered their references to this GACed assembly using
[quoted text clipped - 58 lines]
> >> >> > assembly
> >> >> > is depending on the one I need to delete?
Nicole Calinoiu - 05 Aug 2005 11:46 GMT
"gacutil  /i /r" is the basic approach.  VStudio setup projects also allow
you to specify registration like this via the properties of an assembly that
is to be installed in the GAC.  (I'm guessing that a call out to gacutil
might be used in this case as well, but I've never cared enough to check
whether that's true or not...)

> Hi and thanks. Just one question:
>
[quoted text clipped - 76 lines]
>> >> >> > assembly
>> >> >> > is depending on the one I need to delete?
David Levine - 03 Aug 2005 23:54 GMT
That's not the way that assemblies in the GAC work. There is no static piece
of data anywhere in the system that contains a list of all the assemblies
that contain references to an assembly in the GAC. A different mechanism for
tracking references was used.

Currently, each time an assembly is installed into the GAC an object called
an InstallReference is used to identify the entity that is installing the
assembly into the GAC. There are various options with this object but you
can think of it as a key that should be unique per entity that installs an
assembly into the GAC. Each unique key is added to the store associated with
the GAC'd assembly. These are the references that get listed...they are not
individual assembly references, they are installing entity references.

When the assembly is uninstalled the same key should be passed to the
uninstall routine, and the key is removed from the GAC. When all the keys
have been removed the assembly itself is removed from the GAC.

The problem you are experiencing is that you have a running application that
has opened up the assembly, and until you get that app or service to
terminate the operating system wont let you delete the file. Use the
SysInternals process explorer to search for who has that assembly loaded. It
may be a service (perhaps a SQL or web service?) that needs to be shutdown.

Many of these details are explained at this blog...
http://blogs.msdn.com/junfeng/archive/2004/09.aspx

> Looking at the manifest of the assembly I am not able to delete from the
> GAC
[quoted text clipped - 28 lines]
>> > assembly
>> > is depending on the one I need to delete?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.