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.
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