Blog Archive

Sunday, August 1, 2010

Getting the Public Key Token of a DLL using "sn" Command

Getting the Public Key Token of a DLL using "sn" Command


For getting a Public Key Token first we have Sign the project.

1. Right click on the Project Properties and Select the Signing Tab.
2. Select the "New" From Dropdown List and Give Name of the file.
3. If we want more security then click give the Password else click OK.
4. Now we can see the .snk file in the project.
5. Build the Project.
6. Open the Visual Studio Tools and select the Command Prompt.
7. Now give the following command to get the public key token.

Sn -T Path of the DLL file including DLL Name with extension

8. This command will show the Public Key Token of the DLL file.
9. For storing the Public Key token of a DLL use the following Command.

Sn -T Path of the DLL file including DLL Name with extension

10. Now open the notepad and Paste and you can see the Public Key Token of the DLL File.