Get PublicKeyToken using external tools

I hate fishing around to get the publickeytoken for my strong named assemblies, so I fished around for a way to do it in Visual Studio. Here's what I did:

  1. Create a new External Tool - I called mine Get PublicKeyToken
  2. Map to the sn.exe file in the Windows SDK <DRIVE:\>Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sn.exe
  3. Add the command you want to execute, in this case, it's -T $(TargetPath) - you can get the TargetPath monniker from the flyout.
  4. Check the Use Output window checkbox.

Get PublicKeyToken

Now, to execute it, select a *.dll file. You can select the file in the bin directory of your dev project, go to Tools->Get PublicKeyToken and the output will be rendered to the Output window.