Home / Code Snippets / Blog article: Get Name Of Current Executing Assembly In C#

| RSS

Get Name Of Current Executing Assembly In C#

March 23rd, 2009 | No Comments | Posted in Code Snippets

This is where reflection comes in handy. The following code snippet shows you how to get the name of executing assembly.

string assemblyName;
assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName;
Console.WriteLine(assemblyName);

 

Output for the above code returns the fully qualified name as shown below

image

 

To just get the Assembly name we can use this snippet.

string assemblyName;
assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
Console.WriteLine(assemblyName);

Here is the output.

image

Leave a Reply 13109 views, 21 so far today |
Tags: ,

Leave a Reply