ToString Method

AssemblyName.ToString Method ()


Returns the full name of the assembly, also known as the display name.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public override string ToString()

Return Value

Type: System.String

The full name of the assembly, or the class name if the full name cannot be determined.

See the description of AssemblyName for the format of the returned string.

The following example gets an AssemblyName object for a hypothetical MyAssembly.exe assembly, and then uses the ToString method to retrieve the full assembly name, or display name.

using System;
using System.Reflection;

public class AssemblyName_GetAssemblyName
   public static void Main()
      // Replace the string "MyAssembly.exe" with the name of an assembly,
      // including a path if necessary. If you do not have another assembly
      // to use, you can use whatever name you give to this assembly.
      AssemblyName myAssemblyName = AssemblyName.GetAssemblyName("MyAssembly.exe");
      Console.WriteLine("\nDisplaying assembly information:\n");

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft