gacutil & GAC install

If you are looking for a way to install into the GAC without using a Microsoft Installer package (msi), here are a couple of ways to do it.

Option 1:
Bundle the gacutil.exe. This will require a library, msvcr71.dll. The sum total is about 440K to be added to your install. They’ll compress down to about 200K. This seems to be the most frequently used mechanism. You have to redistribute gacutil.exe because its part of the Microsoft.NET SDK and not installed on most people’s machines.

Option 2:
Write your own c# code to do it. After searching for a very long time, I did manage to find some obscure APIs to do the same thing. The good news is that now you can write managed code to do this, and it only takes about 16K of code. Woo hoo!

    System.EnterpriseServices.Internal.Publish foo = new System.EnterpriseServices.Internal.Publish();

If you want Microsoft’s gory details of the GAC API, you can check here.