Home > Visual Studio 2010 > Simple way to get the 4-part strong name for an assembly

Simple way to get the 4-part strong name for an assembly

As you will know when building SharePoint solutions you always need to determine the 4-part assembly name or Strong Name for inclusion in various solution and feature manifests. I typically got this by pointing Reflector at my compiled DLL files.


Simpler way using Power Shell

Using the ‘External Tools’ option within visual studio you can create a quick link, so from your solution just click the ‘Get 4-Part Name’ link and out pops the 4-part assembly name in you’re output window.


Resulting output window…


How to add a new External Tool

Select ‘External Tools…’ from the Tools menu in Visual Studio


TITLE : Give the tool a title. You can use an ‘&’ character which will act as a short cut i.e. ALT+G.

COMMAND : powershell.exe

Arguments: -command "[System.Reflection.AssemblyName]::GetAssemblyName(\"$(TargetPath)\").FullName"

3. Make sure you check ‘use output window’ to post the result in the VS output window.


Simple but a great time saver :)

About these ads
  1. Sander Schutten
    May 18, 2010 at 10:25 pm

    The given command argument didn’t work for me. I’d to change it to:
    -command “[System.Reflection.AssemblyName]::GetAssemblyName(‘$(TargetPath)’).FullName”
    thanks anyway for setting me in the right direction

    • June 29, 2010 at 1:51 pm

      Hey Sander, sorry for taking so long to get back to you. I just checked this out again. I you copied the -command line from my post it seemed to use an alternate ” character and therefore didnt work. I have reformatted the post content and tried this. Seems to work ok now. Let me know how you get on.

      c :)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: