Export (0) Print
Expand All

AssemblyName::ToString Method

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

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

virtual String^ ToString() override

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

using namespace System;
using namespace System::Reflection;
int 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" );
   Console::WriteLine( myAssemblyName );

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft