Wednesday, 7 September 2011

How to get Public Key Token using Visual Studio

Most of the times we need public key token of DLL to use it in web.config. We can get the public key token using Visual Studio.

To get that, we need to follow below steps:
1) In Visual Studio, Go to Tools and then click on External Tools

2) New window will open, then click on Add and enter the details as below:
  1. Title: Get Public Key Token
  2. Command: It depends on where you installed SDK. In my case it is C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe
  3. Arguments: -Tp "$(TargetPath)"
  4. Also check the checkbox "Use Output Window" and uncheck other checkboxes
3) Click on OK button. Now the "Get Public Key Token" will be available in Tools:


4) So now we are ready to use this. After giving strong name to your assembly, you can click on "Get Public Key Token". You will get Public Key Token in output window.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...