Tuesday, 5 July 2011

Get assembly fully qualified name

While doing development it has occurred to me many times how to get the assembly name easily of a dll(that is strong named). The normal approach is to create it manually from the properties of the dll file.

I would like to share with you a very eazy way to get the fully qualified assembly name using Visual Studio. It uses the external tools feature of Visual Studio.

  1. Open Visual Studio
  2. Go to Tools –> External Tools
  3. Click on "Add" to add a tool, and put in the following values:
    1. Title: Get Qualified Assembly Name
    2. Command: Powershell.exe
    3. Arguments: -command "[System.Reflection.AssemblyName]::GetAssemblyName(\"$(TargetPath)\").FullName"
    4. Check "Use Output Window". All other checkboxes should be unchecked
The new tool appears under Tools –> Get Qualified Assembly Name.

When this menu item is selected, the assembly name is given in the output window.
It should look like HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b2135059549c7590

No comments:

Post a Comment