How to install DLL files in GAC
As a developer I often need to place dlls in GAC (Global Assembly Cache) via scripts. This is easily done using gacutil.exe. xcopy can’t be used since the c:\windows\assembly folder is not really a normal folder.
I will give 2 examples that can be used as postbuild scripts in Visual Studio if you place it in a .bat file.
Example 1 (Windows Server 2003):
@SET GACUTIL=”c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe”
Echo Installing mydll in GAC
%GACUTIL% -if bin\debug\mydllL.dll
Example 2 (Windows Server 2008):
@SET GACUTIL=”C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe”
Echo Installing mydll in GAC
%GACUTIL% -if bin\debug\mydllL.dll
Please not that gacutil is not really made to deploy your DLLs in production environment. It’s a developers tool, and thats the reason it’s not a standard file in Windows 2003, Windows 2008. It’s part of .NET SDKs.
For production environment you can use .msi packages and various installers and also setup project form Visual Studio.
Related posts:
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.