Many times we need to get the Public key token for a strongly named assembly in .NET. FAQ on that “how to get the public key token?”. Answer is very simple use the .NET Framework tools sn.exe. So open the Visual Studio 2008 Command Prompt and then point to the dll’s folder you want to get the public key,
Use the following command,
sn –T myDLL.dll
This will give you the public key token. Remember one thing this only works if the assembly has to be strongly signed.
C:\WINNT\Microsoft.NET\Framework\v3.5>sn -T EdmGen.exe
Microsoft (R) .NET Framework Strong Name Utility Version 3.5.21022.8
Copyright (c) Microsoft Corporation. All rights reserved.
Public key token is b77a5c561934e089
Thank You!! Magical tip!!
Thanks much for this post. Yes, 5 years later people are still reading it.
@Chris F - Thanks a lot glad it helped. My intension is to help community.
@Suja - Thanks a lot and glad!!!
Fantastic - and yes I used the Visual Studio command prompt.
There is no such thing as a VS 2008 command prompt.