How to find public key token for a .NET DLL or assembly

I had to find the public key token for a strongly named assembly in .NET. Searching for a solution, I came along Wriju’s Blog. It appears the answer is very simple: use the .NET Framework tool ‘sn.exe’. Since I do not want to forget about this one, here it is:

  1. Open the Visual Studio <version reflecting DLL creator/signer> Command Prompt
  2. Point to the dll’s folder you want to get the public key
  3. Use the following command: sn –T myDLL.dll

This will give you the public key token. Of course this only works if the assembly is strongly signed :) .