Assembly.FullName Свойство

Определение

Получает отображаемое имя сборки.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

Значение свойства

String

Отображаемое имя сборки.The display name of the assembly.

Реализации

Примеры

В следующем примере извлекается отображаемое имя выполняющейся сборки и отображаемое имя сборки, содержащей Int32 тип ( int в C#, Integer в Visual Basic).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

Комментарии

AssemblyNameОписание формата отображаемого имени сборки см. в разделе.See AssemblyName for a description of the format of the display name of an assembly.

Примечание

Не рекомендуется писать собственный код для синтаксического анализа отображаемых имен.Writing your own code to parse display names is not recommended. Вместо этого передайте отображаемое имя в AssemblyName конструктор, который анализирует его и заполняет соответствующие поля нового объекта AssemblyName .Instead, pass the display name to the AssemblyName constructor, which parses it and populates the appropriate fields of the new AssemblyName.

В .NET Framework версии 2,0 архитектура процессора добавляется в удостоверение сборки и может быть указана в качестве части строк имен сборок.In the .NET Framework version 2.0, processor architecture is added to assembly identity, and can be specified as part of assembly name strings. Однако он не включается в строку, возвращаемую FullName свойством, по причинам совместимости.However, it is not included in the string returned by the FullName property, for compatibility reasons. См. раздел AssemblyName.ProcessorArchitecture.See AssemblyName.ProcessorArchitecture.

Применяется к

См. также раздел