Tuesday, June 26, 2007

Automatic dll registration in GAC

1) Create a Strong-Name for your project. Following steps describes the way to create a Strong-Name:
a. Open the your project properties

b. Go to Signing section in your page, select new in dropdown. “Create Strong Name Key” dialog box gets opened. Enter your strong name and uncheck the check box (as shown in figure below).

2) Now go to Build Events section of property page. Click the Edit Post-build button and enter following command in it:

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i $(TargetFileName)

Note: The above path may vary, depending up on the path where you installed your VSTS.

3) Now if you build your project, your project’s dll will be automatically registered in the Global Assembly Cache (GAC).

No comments: