Monday, March 29, 2010

Create a Tool to Get the Full Name of an Assembly

Title: Create a Tool to Get the Full Name of an Assembly

Details: Here is a wonderful way to create a tool to get the full name of an assembly provided by Microsoft ( original link ). Create a command line project and name it as GetAssemblyName using the below code. Below are few screenshots how it looks like ( output ) after you create it.

#1 Adding the tool to the External Tools on your Visual Studio 2010
#2 Linking the Tool
#3 Using the tool and output


using System;
using System.Reflection;
using System.IO;

namespace GetAssemblyName
class Program
static void PrintUsage()
Console.WriteLine("Usage: GetAssemblyName.exe \n");
Console.WriteLine(@"Example: GetAssemblyName.exe C:\MyAssembly.dll");

static void Main(string[] args)
if (args.Length < 1 || args[0] == "?")

string filename = args[0];

AssemblyName an = AssemblyName.GetAssemblyName(filename);
Console.WriteLine("Fully specified assembly name:\n");
catch (FileNotFoundException)
Console.WriteLine("Cannot locate the assembly. Check the path and try again.");


To add a Get Assembly Full Name item to the Tools menu

  • In Visual Studio, select External Tools from the Tools menu.

  • In the External Tools dialog, click Add and enter Get Assembly Full Name for the Title.

  • Fill the Command textbox by browsing to GetAssemblyName.exe.

  • In the Arguments textbox, type the following (which is case sensitive): $(TargetPath)

  • Enable the Use Output window checkbox. Click OK.

  • The new command is added to the Tools menu.

Technorati Tags: ,

1 comment:

Sandeep K Nahta said...

Another way to get the same result

I think there is yet another way using Reflector also ...

Just in case you want to avoid writing code :)