March 13, 2004

Avoid the GAC

Chris Sells tells us to Avoid the GAC.

In my previous DeepSize post, my instructions include using gacutil which, of course, installs DeepSize into the GAC. While my little application will never get updated by another party and possibly installed over the a version you may have already installed (wishful thinking), I suppose I should reconsider my choice to use the GAC for DeepSize.

After doing some research, it looks like I have to put the explorer extension in the GAC. I tried various configurations such as placing DeepSize.dll in a directory on my SYSTEM path and calling regasm. I understand that COM doesn't deal with the path since explicit references to the path a COM DLL is located is hard-wired into the registry when regsvr32.exe is invoked on the library. However, none of those scenarios worked.

I Googled for a few more articles on the topic of Explorer extensions and one link in particular corroborated the original Code Project article's instructions on placing the Explorer extension in the GAC. See Extending Explorer with Band Objects using .NET and Windows Forms (also on Code Project).

Furthermore, I'm beginning to understand the role of RegAsm.exe as opposed to regsvr32.exe. You can't register a .NET DLL using regsvr32.exe since a .NET DLL doesn't support the old COM registration functions. RegAsm.exe works through COM Interop, which, while it exposes .NET objects as COM objects, it doesn't do it through old fashion means of DllRegisterServer() and DllUnregisterServer().

I definitely dig having the Chris Sells piece in my mind. However, I'm also glad I've gained a little personal experience on when to do and not to do something.

Posted by Nick Codignotto at March 13, 2004 07:41 AM | TrackBack
Posted to Programming
Comments
Post a comment









Remember personal info?






Valid XHTML 1.0!   Valid CSS!