Retrieving an Assembly PublicKeyToken

Getting the PublicKeyToken

 The PublicKeyToken always tends to slow you down it seems. Your moving right along in development, then you have to jet out of Visual Studio and grab the public key token. Some people I know use reflector to quickly grab the token. That seems like a lot of work though. The fastest way I have found to do is to quickly run your “Visual Studio Command Prompt” with the following:

Sn –T assemblyName.dll

Of course when you run the above you will need to be in the same directory as the assembly. And it spits out the PublicKeyToken right at you:

 Capture

Now that is great! But what is even cooler, is you can simply plug it into Visual Studio if you want, so you never have to leave the comfort of the dev environment.

PublicKeyToken Visual Studio Integration

 Capture2 

1. Head on over too Visual Studio, and open up Tools -> External Tools

2. Enter the information for the tool as follows:

 Capture3

The command path varies per system, but by default is: C:Program FilesMicrosoft SDKsWindowsv6.0ABinsn.exe

3. And that’s it. All you have to do is open up a file inside any project, then go Tools -> Get SN Token and the PublicKeyToken will appear in the output window of VS.

One Comments

  1. Reignbeau says:

    What an awesome way to elxpian this-now I know everything!

Leave a Reply to Reignbeau