by Semicton
5. March 2010 16:41
Here is an easy way to display the public key token of a signed assembly from within Visual Studio.
In Visual Studio choose Tools from the tool bar then choose External Tools.

A new dialog box will appear. Click the Add button and fill the fields below:
Title: Get &PublicKeyToken
Command: C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sn.exe
Argumnets: -Tp $(TargetPath)
Place a check mark in the Use Output window option.

To Test:
Sign your assembly, then goto Tools and you will find your Get PublicKeyToken available in the list. The public key tolken will now print to the Output window.

Printed Example:
Microsoft (R) .NET Framework Strong Name Utility Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
Public key is
0024000004800000940000000602000000240000525341310004000001000100ed4f1697d3045d
3b0384b1b2f3c334a2d7af32786dd2b15682a26238d72062db97853db569974f826c46c469d1a7
446ce305cb19cdfa31d110d09027630f3d497c8d987d3ec75923fd0dbafd5834d8b7544be9e52b
b9c7e23746bfe07cde2c8e07ab27e212eee74e405185fc67fedf6b430d955f70d6bd5d51e38fe1
9e5f7ace
Public key token is e8247507e0bdf57b