Sponsored Ad

Saturday, July 23, 2011

Find Current Executing Assembly Name using C# Program

You can find out current executing assembly name by using the reflection. Reflection provide lot more details about the current executing assembly and you can read at runtime. The fully executing code is given below.

The below code is using GetExecutingAssembly() method to get the detail of current assembly.

Find Current Executing Assembly Name using C# Program

C# Example to Display Current Assembly Name:

using System;
using System.Data;

namespace DemoConsoleApplication

    class Get_Current_Assembly
    {
        static void Main(string[] args)
        {
            string str_Assembly_Name;
            str_Assembly_Name = System.Reflection.Assembly.GetExecutingAssembly().FullName;
            Console.WriteLine("Full Assembly Name: " + str_Assembly_Name);

            str_Assembly_Name = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
            Console.WriteLine("Only Assembly Name: " + str_Assembly_Name);

            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates