次の方法で共有


Assembly.FullName Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the display name of the assembly.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property FullName As String
public virtual string FullName { get; }

Property Value

Type: System.String
The display name of the assembly.

Remarks

See AssemblyName for a description of the format of the display name of an assembly.

NoteNote:

Writing your own code to parse display names is not recommended. Instead, pass the display name to the AssemblyName constructor, which parses it and populates the appropriate fields of the new AssemblyName.

Examples

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).

Imports System.Reflection

Class Example

    Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)

        outputBlock.Text &= "The FullName property (also called the display name) of..." & vbCrLf
        outputBlock.Text &= "...the currently executing assembly:" & vbCrLf
        outputBlock.Text &= Assembly.GetExecutingAssembly().FullName & vbCrLf

        outputBlock.Text &= "...the assembly that contains the Int32 type:" & vbCrLf
        outputBlock.Text &= GetType(Integer).Assembly.FullName & vbCrLf
    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:
'SilverlightApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
'...the assembly that contains the Int32 type:
'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
using System;
using System.Reflection;

class Example
{
    public static void Demo(System.Windows.Controls.TextBlock outputBlock)
    {
        outputBlock.Text += "The FullName property (also called the display name) of...\n";
        outputBlock.Text += "...the currently executing assembly:\n";
        outputBlock.Text += Assembly.GetExecutingAssembly().FullName + "\n";

        outputBlock.Text += "...the assembly that contains the Int32 type:\n";
        outputBlock.Text += typeof(int).Assembly.FullName + "\n";
    }
}

/* This example produces output similar to the following:

The FullName property (also called the display name) of...
...the currently executing assembly:
SilverlightApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
...the assembly that contains the Int32 type:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
 */

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.