Assembly.FullName Eigenschaft

Definition

Ruft den Anzeigenamen der Assembly ab.Gets the display name of the 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

Eigenschaftswert

String

Der Anzeigename der Assembly.The display name of the assembly.

Implementiert

Beispiele

Im folgenden Beispiel wird der Anzeige Name der aktuell ausgeführten Assembly und der Anzeige Name der Assembly, die den Int32 Typ enthält ( int in c#, Integer in Visual Basic) abgerufen.The following example retrieves the display name of the currently executing assembly, and the display name of the assembly that contains the Int32 type (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 anzeigen Amens einer Assembly finden Sie unter AssemblyName .See AssemblyName for a description of the format of the display name of an assembly.

Hinweis

Das Schreiben von eigenem Code zum Analysieren von anzeigen Amen ist nicht empfehlenswert.Writing your own code to parse display names is not recommended. Übergeben Sie stattdessen den anzeigen Amen an den AssemblyName -Konstruktor, der ihn analysiert und die entsprechenden Felder der neuen auffüllt AssemblyName .Instead, pass the display name to the AssemblyName constructor, which parses it and populates the appropriate fields of the new AssemblyName.

In der .NET Framework Version 2,0 wird die Prozessorarchitektur der Assemblyidentität hinzugefügt und kann als Teil der assemblynamenszeichenfolgen angegeben werden.In the .NET Framework version 2.0, processor architecture is added to assembly identity, and can be specified as part of assembly name strings. Aus Kompatibilitätsgründen ist Sie jedoch nicht in der Zeichenfolge enthalten, die von der-Eigenschaft zurückgegeben wird FullName .However, it is not included in the string returned by the FullName property, for compatibility reasons. Siehe AssemblyName.ProcessorArchitecture.See AssemblyName.ProcessorArchitecture.

Gilt für:

Siehe auch