Assembly.FullName Eigenschaft

Definition

Ruft den Anzeigenamen der Assembly ab.

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

Eigenschaftswert

Der Anzeigename der Assembly.

Implementiert

Beispiele

Im folgenden Beispiel werden der Anzeigename der gerade ausgeführten Assembly und der Anzeigename der Assembly abgerufen, die den Int32 Typ enthält (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

Hinweise

Eine Beschreibung des Formats des Anzeigenamens einer Assembly finden Sie AssemblyName unter.

Hinweis

Das Schreiben ihres eigenen Codes zum Analysieren von Anzeigenamen wird nicht empfohlen. Übergeben Sie stattdessen den Anzeigenamen an den Konstruktor, der AssemblyName ihn analysiert und die entsprechenden Felder des neuen AssemblyNameauffüllt.

In .NET Framework Version 2.0 wird die Prozessorarchitektur der Assemblyidentität hinzugefügt und kann als Teil von Assemblynamenzeichenfolgen angegeben werden. Es ist jedoch aus Kompatibilitätsgründen nicht in der von der FullName -Eigenschaft zurückgegebenen Zeichenfolge enthalten. Siehe AssemblyName.ProcessorArchitecture.

Gilt für:

Weitere Informationen