Coffeehouse Thread27 posts
Forum Read Only
This forum has been made read only by the site admins. No new threads or comments can be added.
Where is GACUTIL?
Back to Forum: Coffeehouse
Conversation locked
This conversation has been locked by the site admins. No new comments can be made.
Pagination.
Actually, there is a managed API that can install an assembly in the GAC: System.EnterpriseServices.Internal.Publish.GacInstall. I've used it, it works great.
Is this new in 2.0? I don't remember it there in 1.1.
And while I've used the EnterpriseServices.Internal namespace before (to create IIS virtual directories), I would hesitate recommending its use. I don't think they're committed to keeping it there without breaking changes.
The docs say it's 2.0, 1.1, and 1.0 compatible. I've only used it in 2.0 though.
Cool. Didn't know about it. I'll keep it in mind.
Thanks guys, great help. I actually needed it for a quick pilot where I wrote a quick mockup but needed stdole from the GAC - quick question - to which I don't really expect an answer, why isn't that installed with the runtime either?
I disagree with this advice.
First off, GACUTIL is part of the .Net SDK not the .Net Redistributible, therefore you are not licensed to redistribute that code.
Secondly, .Net and the CLR were designed to mitigate the problems associated with sharing library code files that everyone calls DLL Hell, the GAC , if used improperly, reintroduces all the pitfalls that COM DLLs had
The GAC makes xcopy deployment moot. If you're going to use the GAC, and since you can't use xcopy now, you should really be using a installation technology that was designed for end-user application installation.. like Windows Installer (MSI). MSI knows how to register assemblies with the end-user's GAC. Dont hack the installation APIs by using GACUTIL.
GACUTIL is for developers not end-users. That's why it's in the SDK but not the Redistributable..
Having the DLLs in the same location as the exe's is the solution to DLL hell as well. When I first started .Net , I immediately assumed that the GAC was good and that's where I should be putting my class libraries because of the reasons you state (code signing,etc).. but I came to the conclusion that the GAC wasn't really giving me any value that would make up for the complexity of deployment and uninstalling. Plus realizing that trying to save hard disk space is really a false economy since the DLL's i'm making are really insignificant in size relative to the sizes of HD now.
I've also come to agree with the train of thought that says an application should only be using the versions of the DLLs that it originally tested/shipped with and the easiest way to implement this is through shipping all the code together and only updating the consumers of DLL updates that were specifically recompiled with those updated DLLs.
So for me at least the benifits of the GAC didn't outweight the potential costs and I stopped using it.
That decision process is one that everyone should make on thier own taking into account their specifics. So I didn't intend to say no one should the GAC, I just wanted to raise some points that are not so apparent up front but ultimately everyone makes thier own decisions.
It was GACUTIL.exe specifically that I think peopel should avoid on the client deployment side.
The .Net Documentation has this note:
In deployment scenarios, use Windows Installer 2.0 to install assemblies into the global assembly cache. Use Windows Explorer or the Global Assembly Cache tool only in development scenarios, because they do not provide assembly reference counting and other features provided when using the Windows Installer.
I agree, use MSI's whenever possible. But I'm trying to distribute an ActiveX control that interops back to a .NET assembly. What is the prescribed GAC installation method for this situation?
According to this thread you have to put .NET assemblies into the GAC for them to be visible to ActiveX controls hosted on a web page (and preliminary tests show this seems to still hold true, the thread is from 2003). So I need to put my assembly into the GAC via a CAB install (aka inf).
Is my "best" option to write a .net app which calls the EnterpriseServices method mentioned earlier just to put my needed assembly into the GAC? That seems like a bad hack instead of a solution.
Could I simply do a:
copy [assembly file name] \windows\assembly\
and shfusion.dll will do its magic? This is scary to me as there doesn't seem to be a good way to get failure messages, and I don't know if that even works.
Any help would be great! I've been scratching my head all day long on this.!
Well, I'm interested
I'm looking for a solution to deploy a managed dll with an unmanaged dll as a linkresource in the GAC.
I need your post:)
Information on this would be a great help.
GACUTIL is part of the .NET Framework SDK. If you're curious where it is in your machine and you know it's in your PATH, try WHERE GACUTIL.EXE from the command line.