Travis Lingenfelder

Travis is a senior consultant for Catapult Systems and blogs about Microsoft technologies including SharePoint, but is passionate about all things relating to technology. Travis is a MCTS for SharePoint Server 2007, application development and configuration.
RSS Feed

Visual Studio Add-in to get an assembly PublicKeyToken

Often times during the course of a development project you may want to easily obtain the PublicKeyToken used to sign the assembly. Most people will add the assembly to the GAC and then use the properties dialog to copy out the information needed to register the assembly with its complete signature. This is especially true for modifying the web.config when doing any type of web or SharePoint development.

Follow the steps in this post to create a Visual Studio add-in tool that will show you the PublicKeyToken directly from Visual Studio.

  1. In Visual Studio, select External Tools from the Tools menu.
  2. In the External Tools dialog, click Add and enter Get Assembly Public Key for the Title.
  3. Fill the Command textbox by browsing to sn.exe. It is typically installed at the following location: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe.
  4. In the Arguments textbox, type the following (case sensitive) -Tp "$(TargetPath)".
  5. Enable the Use Output window checkbox.
  6. Click OK. The new command is added to the Tools menu.

After building the assembly, select Get Assembly Public Key from the Tools menu in Visual Studio and the PublicKeyToken will be displayed Visual Studio's output window.

Posted by Travis Lingenfelder on Wednesday, 16 Apr 2008 02:30
1 Comment | Filed under: Development, Visual Studio
Bookmark this post with:        

Links to this post

A Guide to SharePoint Performance Testing (Part I) – What is “Acceptable” Anyway?

Trackback from  David Broussard  on  M/d/yyyy



Comments

On 27 Oct 2009 10:38, Web developers said:

That was inspiring, Those steps for the add on are perfect, Thanks for sharing, Keep up the good work

Leave a comment

Name (required)

Url

Email

Comments

Complete this section to post your comment