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 | 1 Comment | 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 29349 views, 13 so far today |
Tags: ,
Follow Discussion

One Response to “Get Name Of Current Executing Assembly In C#”

  1. Phil Steel Says:

    You can modify this slightly to get it for the current Silverlight Application:

    Application.Current.GetType().Assembly.FullName.Split(‘,’)[0]

Leave a Reply