Assembly.FullName Propiedad

Definición

Obtiene el nombre para mostrar del ensamblado.

public:
 virtual property System::String ^ FullName { System::String ^ get(); };
public virtual string FullName { get; }
public virtual string? FullName { get; }
member this.FullName : string
Public Overridable ReadOnly Property FullName As String

Valor de propiedad

String

Nombre para mostrar del ensamblado.

Implementaciones

Ejemplos

En el ejemplo siguiente se recupera el nombre para mostrar del ensamblado que se está ejecutando actualmente y el nombre para mostrar del ensamblado que contiene el Int32 tipo (int en C#, Integer en Visual Basic).

using namespace System;
using namespace System::Reflection;

void main()
{
    Console::WriteLine("The FullName property (also called the display name) of...");
    Console::WriteLine("...the currently executing assembly:");
    Console::WriteLine(Assembly::GetExecutingAssembly()->FullName);

    Console::WriteLine("...the assembly that contains the Int32 type:");
    Console::WriteLine(int::typeid->Assembly->FullName);
}

/* This example produces output similar to the following:

The FullName property (also called the display name) of...
...the currently executing assembly:
ExampleAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
...the assembly that contains the Int32 type:
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 */
using System;
using System.Reflection;

class Example
{
    static void Main()
    {
        Console.WriteLine("The FullName property (also called the display name) of...");
        Console.WriteLine("...the currently executing assembly:");
        Console.WriteLine(typeof(Example).Assembly.FullName);

        Console.WriteLine("...the assembly that contains the Int32 type:");
        Console.WriteLine(typeof(int).Assembly.FullName);
    }
}

/* This example produces output similar to the following:

The FullName property (also called the display name) of...
...the currently executing assembly:
ExampleAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
...the assembly that contains the Int32 type:
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 */
Imports System.Reflection

Class Example
    Shared Sub Main()
        Console.WriteLine("The FullName property (also called the display name) of...")
        Console.WriteLine("...the currently executing assembly:")
        Console.WriteLine(GetType(Example).Assembly.FullName)

        Console.WriteLine("...the assembly that contains the Int32 type:")
        Console.WriteLine(GetType(Integer).Assembly.FullName)
    End Sub 
End Class 

' This example produces output similar to the following:
'
'The FullName property (also called the display name) of...
'...the currently executing assembly:
'ExampleAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
'...the assembly that contains the Int32 type:
'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Comentarios

Vea AssemblyName para obtener una descripción del formato del nombre para mostrar de un ensamblado.

Nota

No se recomienda escribir su propio código para analizar los nombres para mostrar. En su lugar, pase el nombre para mostrar al AssemblyName constructor, que lo analiza y rellena los campos adecuados del nuevo AssemblyName.

En .NET Framework versión 2.0, la arquitectura del procesador se agrega a la identidad del ensamblado y se puede especificar como parte de las cadenas de nombre de ensamblado. Sin embargo, no se incluye en la cadena devuelta por la FullName propiedad , por motivos de compatibilidad. Vea AssemblyName.ProcessorArchitecture.

Se aplica a

Consulte también