I've been explaining this tip in Mindsharp’s SharePoint Developer training for years and I've had people ask me repeatedly to blog it, so here goes.
Both Visual Studio (VS.NET) 2005 and 2008 make it quite easy to sign .NET assemblies with a strong name key (SNK) public key/private key pair directly from the Properties of the project.
However, after the assembly is compiled, nothing in the default VS.NET IDE can obtain the public key that was embedded within the assembly. So, the command-line Strong Name Tool (sn.exe) is often used to peek into the assembly for the public key token and the public key blob using the following command (run within a VS.NET Command Prompt):
sn -Tp [pathToAssembly]\[assemblyFileName]
While this is not difficult, it is terribly inefficient. Not only does it require the developer to open a command window, but also:
- Remember the command,
- Remember the parameters,
- Use the correct case of those parameters (the T must be uppercase, the p must be lowercase),
- Locate or type the full path to the assembly (in double quotes please), and
- Execute the command
What’s worse, VS.NET knows exactly where the assembly was created; it just does not provide an interface to peek into the assembly to see the public key token and the public key blog.
It is also possible to drag (or GacUtil.exe) the DLL into the GAC to see the public key token (not the public key blob); Red Gate’s .NET Reflector can also show an assembly’s public key token.
However, there is hope. VS.NET allows developers to setup "External tools". The Strong Name Tool (sn.exe) is an external tool. So, with a little configuration of the IDE, a Get Public Key menu option can be added to the Tools menu.

Optionally, a Get Public Key icon can even be included directly on the toolbar. Then, just click the icon to get the public key token and the public key blob from any compiled assembly that is in focus in the Solution Explorer.
You can find a step by step explanation showing how to add the menu option and the toolbar option in the the PDF that I published privately last year. Be aware, the paper describes steps for VS.NET 2005 but VS.NET 2008 installs sn.exe in a different location than VS.NET 2005:
Make sure to use this VS.NET 2008 location when creating the Get Public Key External Tool.
<Todd />