Wednesday, May 19, 2010

Generating Public Key Token in Visual Studio

The "Public Key Token" is the unique identifier for a DLL that is deployed in GAC (Global Assembly Cache). This is particularly important for me, as I need to specify that in Features.xml file for SharePoint development.


Now, getting the Public key Token is not that simple. Either you have to drag the DLL to assembly, then only you will find the Public Key Token along with the other information like Assembly Name, Version etc.


Following are the steps for generating the Public Key Token right inside the Visual Studio 2005/2008 (This screen shots are from VS 2008)


First, you need the create your Project or the Class Library, write the required coding, then sign the assembly with a key.


Secondly follow these steps, this is one time effort and can be used for n number of projects.





On the following screen you need to pass the following information
Title: A convenient title to remember
Command: C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sn.exe
Arguments: -Tp $(TargetPath)
(note: the argument field is case sensitive)







No comments: