Rossj wrote: Help - I've lost it. I installed a .Net 2.0 runtime today and it didn't install gacutil ... anyone know..
b. Where I can find it ...
a. GACUTIL doesn't come with the .NET Runtime, but with the .NET SDK - also a free download, but not part of the basic redistributable. The SDK is installed with Visual Studio, so development machines always have it.
Yes, this sucks big-time. And no, there aren't any managed APIs that can register/unregister things in the GAC. GACUTIL binds to unmanaged functions.
I'm guessing you need this for deployment? There are several ways to go about it:
1) Bundle GACUTIL.EXE with your installation package.
2) Install in the GAC by copying your DLL into C:\WINDOWS\Assembly. This isn't a perfect solution - I'm pretty sure only copying from Windows Explorer does the trick, and other methods may not work.
3) Install in GAC using your MSI Installer of choice - the built in Visual Studio Installer project can install assemblies in the GAC simply by adding a Global Assembly Cache folder as part of the destination filesystem.
If you need GACUTIL for other purposes - cleaning the Download Cache or whatnot - you'll have to find alternate ways of doing it.
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.