How do I register an DLL in GAC
Posted Date: 24 Jun 2005 Posted By:: Vipul Mehta Member Level: Silver Member Rank: 2279 Points: 2
I have created an DLL & how do I register that DLL into GAC so that all my applns in my machine.
|#23880 Author: Abhay Member Level: Gold Member Rank: 0 Date: 24/Jun/2005 Rating: Points: 2|
Review This Steps
|#23918 Author: reshma Member Level: Silver Member Rank: 0 Date: 25/Jun/2005 Rating: 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:
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.
| ||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.