Forums » .NET » .NET »

How do I register an DLL in GAC

Posted Date: 24 Jun 2005      Posted By:: Vipul Mehta Profile photo    Member Level: Silver    Member Rank: 2233     Points: 2   Responses: 2

Hi Friends,
I have created an DLL & how do I register that DLL into GAC so that all my applns in my machine.

Vipul Mehta


#23880    Author: Abhay      Member Level: Gold      Member Rank: 0     Date: 24/Jun/2005   Rating: 2 out of 52 out of 5     Points: 2

Review This Steps

Cheers !!!

Abhay Lakkad

#23918    Author: reshma      Member Level: Silver      Member Rank: 0     Date: 25/Jun/2005   Rating: 2 out of 52 out of 5     Points: 2

The link that Abhay has given is good. But I would like to add something to that:

To place a dll into the GAC the following steps need to be done:

1. Generating a public key or a strong name
2. Adding the public key to the AssemblyInfo.vb file of the DLL. This step is called Signing the Assembly with a public key.
3. Build the assembly
4. Placing the dll into GAC .

1. Generating the public key:
As Abhay said, go to visualStudio.Net command prompt and type the following command:

sn -k keyfile1.snk
Here keyfile1.snk is the keyfile we are generating.

You can store this key file in the bin folder of the assembly. In order to do this u have to go to the bin folder. For example:
C:\foldername\assemblyname\bin sn-k keyfile1.snk

By doing this the keyfile is stored in the bin folder.

2. Placing the keyfile into the Assembly.
Go to AssemblyInfo.vb file:
<Assembly: AssemblyKeyFile("C:\foldername\assemblyname\\keyfile1.snk")>
3. Build the Assembly.

4. Placing the assembly into GAC

There are two way in which u can place the assembly into GAC.
1. Using the utility gacutil -i
Here you should give the complete path of the dll

c:\>gactutil -i c:\foldername\assemblyname\bin\assemblyname.dll

2. The second method is u can drag the .dll file from the bin folder of the assembly and drop it into the folder C:\winnt\Assembly

Doing this is same ie placing assembly into GAC.

Good Luck.

Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.

Previous : Is there any expert to solve this?
Return to Discussion Forum
Post New Message
Category: .NET

Subscribe to Subscribers
Awards & Gifts
Talk to Webmaster Tony John

Online Members

Gopi A
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India