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

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>