Type.Assembly プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

現在の型を含むアセンブリを説明する Assembly インスタンス。ジェネリック型の場合、インスタンスは特定の構築型を作成および使用するアセンブリではなく、ジェネリック型定義を含むアセンブリを説明します。

現在の Type オブジェクトが構築ジェネリック型を表している場合、このプロパティはジェネリック型定義を含むアセンブリを返します。たとえば、ジェネリック型定義 MyGenericStack<T> (Visual Basic では MyGenericStack(Of T)、C++ では generic<T> ref class MyGenericStack) を含む、MyGenerics.dll という名前のアセンブリを作成するとします。MyGenericStack<int> (Visual Basic では MyGenericStack(Of Integer)) のインスタンスを別のアセンブリに作成すると、その構築型の Assembly プロパティは MyGenerics.dll を表す Assembly オブジェクトを返します。
同様に、現在の Type オブジェクトが、割り当てられていないジェネリック パラメータ T を表している場合、このプロパティは T を定義するジェネリック型を含むアセンブリを返します。

クラスに関連付けられたアセンブリ名とその型の完全限定名を表示する例を次に示します。
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
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()); } }
using namespace System; using namespace System::Reflection; int main() { Type^ objType = System::Array::typeid; // Print the full assembly name. Console::WriteLine( "Full assembly name: {0}.", objType->Assembly->FullName ); // Print the qualified assembly name. Console::WriteLine( "Qualified assembly name: {0}.", objType->AssemblyQualifiedName ); }
import System.*; import System.Reflection.*; class MyAssemblyClass { public static void main(String[] args) { Type objType = System.Array.class.ToType(); // Print the full assembly name. Console.WriteLine("Full assembly name: {0}.", objType.get_Assembly().get_FullName().ToString()); // Print the qualified assembly name. Console.WriteLine("Qualified assembly name: {0}.", objType.get_AssemblyQualifiedName().ToString()); } //main } //MyAssemblyClass

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Type.Assembly プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)


このプロパティは、アンマネージ コードからマネージ クラスにアクセスするためのプロパティであるため、マネージ コードからは呼び出さないでください。
Type.Assembly プロパティは、型が宣言される Assembly を取得します。ジェネリック型の場合、このプロパティはジェネリック型が定義される Assembly を取得します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.Assemblyのページへのリンク