Assembly.FullName Proprietà

Definizione

Ottiene il nome visualizzato dell'assembly.

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

Valore della proprietà

Nome visualizzato dell'assembly.

Implementazioni

Esempio

Nell'esempio seguente viene recuperato il nome visualizzato dell'assembly attualmente in esecuzione e il nome visualizzato dell'assembly contenente il Int32 tipo (int in C#, Integer in 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

Commenti

Vedere AssemblyName per una descrizione del formato del nome visualizzato di un assembly.

Nota

Non è consigliabile scrivere il proprio codice per analizzare i nomi visualizzati. Passare invece il nome visualizzato al AssemblyName costruttore, che lo analizza e popola i campi appropriati del nuovo AssemblyName.

Nella versione 2.0 di .NET Framework l'architettura del processore viene aggiunta all'identità dell'assembly e può essere specificata come parte delle stringhe dei nomi dell'assembly. Tuttavia, non è incluso nella stringa restituita dalla FullName proprietà, per motivi di compatibilità. Vedere AssemblyName.ProcessorArchitecture.

Si applica a

Vedi anche