Q:

C# program to print the current assembly name using GetExecutingAssembly() method

0

C# program to print the current assembly name using GetExecutingAssembly() method

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

The source code to print the current assembly name using GetExecutingAssembly() method is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.

//C# program to print current assembly name 
//using GetExecutingAssembly() method.

using System;
using System.Reflection;

class Program
{
    static void Main(string[] args)
    {
        Assembly asm;
        asm     = Assembly.GetExecutingAssembly();

        Console.WriteLine(asm.FullName);
    }
}

Output:

Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Press any key to continue . . .

Explanation:

Here, we imported the System and System.Reflection namespace. Here we created a Program class that contains the Main() method. The Main() method is the entry point for the program. In the Main() method we printed the name of the current program assembly, version, and culture information on the console screen.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Basic Programs | Class, Object, Methods

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C# program to demonstrate the interface... >>
<< C# program to check a specified type is public or ...