Share via


Type.Assembly プロパティ

型が宣言される Assembly を取得します。

Public MustOverride ReadOnly Property Assembly As Assembly
[C#]
public abstract Assembly Assembly {get;}
[C++]
public: __property virtual Assembly* get_Assembly() = 0;
[JScript]
public abstract function get Assembly() : Assembly;

プロパティ値

現在の型を含むアセンブリを説明する Assembly インスタンス。

解説

このプロパティは読み取り専用です。

使用例

[Visual Basic, C#, C++] クラスに関連付けられたアセンブリ名とその型の完全限定名を表示する例を次に示します。

 
Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Class MyAssemblyClass
    Public Shared Sub Main()
        Dim objType As Type = GetType(System.Array)
        ' Print the full assembly name.
        Console.WriteLine("Full assembly name: {0}.", objType.Assembly.FullName.ToString())
        ' Print the qualified assembly name.
        Console.WriteLine("Qualified assembly name: {0}.", objType.AssemblyQualifiedName.ToString())
    End Sub 'Main
End Class 'MyAssemblyClass

[C#] 
using System;
using System.Reflection;

class MyAssemblyClass
{

    public static void Main()
    {
        Type objType = typeof(System.Array);
                    
        // Print the full assembly name.
        Console.WriteLine ("Full assembly name: {0}.", objType.Assembly.FullName.ToString()); 

        // Print the qualified assembly name.
        Console.WriteLine ("Qualified assembly name: {0}.", objType.AssemblyQualifiedName.ToString()); 
    }
}

[C++] 
#using <mscorlib.dll>

using namespace System;
using namespace System::Reflection;
int main() {
   Type*  objType = __typeof(System::Array);

   // Print the full assembly name.
   Console::WriteLine (S"Full assembly name: {0}.", objType->Assembly->FullName); 

   // Print the qualified assembly name.
   Console::WriteLine (S"Qualified assembly name: {0}.", objType->AssemblyQualifiedName); 
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

参照

Type クラス | Type メンバ | System 名前空間