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 / .NET SDK / August 2007

Tip: Looking for answers? Try searching our database.

Uninstalling from Global assembly cache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt - 07 Aug 2007 20:24 GMT
I am trying to install and uninstall assemblies from GAC.
I created a batch file which has following command in it:
  gacutil.exe /if MyCommonAssembly.dll
Above command successfully installs MyCommonAssembly in GAC.
But when I create a another Batch file which contains:
gacutil.exe /u MyCommonAssembly
and I run the batch file, the command is executed but the assembly is
appears in GAC and Windows --> Assembly folder.

if I  execute this command on cmd prompt then it is uninstalled from the
Assembly folder and also from the GAC.
Any suugestions?
Phil Wilson - 07 Aug 2007 21:04 GMT
You're using /if to force replacement - does that mean there is already an
assembly of that name in the GAC?  Is that the only option in your command
(you didn't do /r?).

Does /uf make any difference? How about if you specify more of the assembly
name (for example adding version)?
Signature

Phil Wilson
[MVP Windows Installer]

>I am trying to install and uninstall assemblies from GAC.
> I created a batch file which has following command in it:
[quoted text clipped - 8 lines]
> Assembly folder and also from the GAC.
> Any suugestions?
Matt - 07 Aug 2007 21:20 GMT
does that mean there is already an assembly of that name in the GAC?
Yes, GAC has an assembly with same name. But I run Uninstall batch file
before Install Batch file.

Is that the only option in your command?
Yes, that is only option I have specified in my command.

Does /uf make any difference?
No, using /uf didnt make any difference.

How about if you specify more of the assembly name?
Well, I didnt try this option but for my purpose I am creating an installer
which in Pre install event uninstalls all the assemblies from the GAC and in
POSTInstall event installs new assemblies in GAC.
Please let me know if you require more information.

> You're using /if to force replacement - does that mean there is already an
> assembly of that name in the GAC?  Is that the only option in your command
[quoted text clipped - 14 lines]
> > Assembly folder and also from the GAC.
> > Any suugestions?
Phil Wilson - 07 Aug 2007 22:48 GMT
You mean a setup&deployment project? That "pre-install" event sounds like
you're running this code in a setup project, which might mean you're running
custom actions in the context of Windows Installer, and that might be
affecting things because in an Installer class you're running impersonated
on an msiexec.exe process.

If you are actually using a setup&deployment project, you should know that
you can get the setup project to install/uninstall assemblies in the GAC
without running any code at all.

I'd also point out that gacutil is not redistributable and is not in most
.NET FW redists, so it won't exist on client systems.

Signature

Phil Wilson
[MVP Windows Installer]

> does that mean there is already an assembly of that name in the GAC?
> Yes, GAC has an assembly with same name. But I run Uninstall batch file
[quoted text clipped - 36 lines]
>> > Assembly folder and also from the GAC.
>> > Any suugestions?
Walter Wang [MSFT] - 08 Aug 2007 04:37 GMT
Hi Matt,

I agree with Phil, if you're calling GacUtil from an installer, you first
need to be aware that GacUtil isn't redistributed with .NET Framework
Runtime; it's in the .NET Framework SDK.

Normally the setup tool may already have builtin support for installing and
uninstall assembly to/from GAC.

My wild guess is that gacuti.exe isn't found at all by the batch file, the
error is missed since you cannot see the output if it's executed silently.

Also, if you do need to call Gacutil.exe from your installer, you should
also be use the "-ir" or "-ur" switch since it can correctly
install/uninstall using reference counts. This will make sure other
programs that are using the shared assembly will not break when one program
is uninstalled.

#Global Assembly Cache Tool (Gacutil.exe)
http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.80,d=printer).aspx
<quote>
Be aware that using the /i and /u options alone does not support reference
counting. These options are appropriate for use during product development
but not for actual product installations.
</quote>

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

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.