Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting assembly name

People also ask

How can I get my full assembly name?

If you know the assembly's file system path, you can call the static (C#) or Shared (Visual Basic) AssemblyName. GetAssemblyName method to get the fully qualified assembly name.

What is an assembly name?

An assembly's name is stored in metadata and has a significant impact on the assembly's scope and use by an application. A strong-named assembly has a fully qualified name that includes the assembly's name, culture, public key, version number, and, optionally, processor architecture.

How do I get assembly name in powershell?

Open Visual Studio Go to Tools –> External Tools –> Add Title: Get Qualified Assembly Name Command: Powershell.exe Arguments: -command "[System. Reflection. AssemblyName]::GetAssemblyName(\"$(TargetPath)\"). FullName" Check "Use Output Window".

What is assembly qualified name?

The assembly-qualified name of a type consists of the type name, including its namespace, followed by a comma, followed by the display name of the assembly. The display name of an assembly is obtained using the Assembly. FullName property.


System.Reflection.Assembly.GetExecutingAssembly().GetName().Name

or

typeof(Program).Assembly.GetName().Name;

I use the Assembly to set the form's title as such:

private String BuildFormTitle()
{
    String AppName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
    String FormTitle = String.Format("{0} {1} ({2})", 
                                     AppName, 
                                     Application.ProductName, 
                                     Application.ProductVersion);
    return FormTitle;
}

You could try this code which uses the System.Reflection.AssemblyTitleAttribute.Title property:

((AssemblyTitleAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyTitleAttribute), false)).Title;


You can use the AssemblyName class to get the assembly name, provided you have the full name for the assembly:

AssemblyName.GetAssemblyName(Assembly.GetExecutingAssembly().Location).Name

or

AssemblyName.GetAssemblyName(e.Source).Name

MSDN Reference - AssemblyName Class


Assembly.GetExecutingAssembly().Location