How to get the Assembly name?

Poster
Posted by Poster under C# category on | Views : 11027
To get assembly name in C#, you can use following code.

        /// <summary>
/// Get assembly name in C#
/// </summary>
/// <returns></returns>
public static string GetAssemblyMyName()
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(Class1));
return assembly.GetName().Name;
}


To get assembly name in VB.NET, use following code.

''' <summary>
''' Get assembly name in C#
''' </summary>
''' <returns></returns>
Public Shared Function GetAssemblyMyName() As String
Dim assembly As System.Reflection.Assembly = System.Reflection.Assembly.GetAssembly(GetType(Class1))
Return assembly.GetName().Name
End Function

Comments or Responses

Login to post response