_Type.AssemblyQualifiedNameとは? わかりやすく解説

Type.AssemblyQualifiedName プロパティ

Type読み込み元であるアセンブリの名前を含む、Typeアセンブリ修飾名を取得します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public MustOverride ReadOnly
 Property AssemblyQualifiedName As String
Dim instance As Type
Dim value As String

value = instance.AssemblyQualifiedName
public abstract string AssemblyQualifiedName
 { get; }
public:
virtual property String^ AssemblyQualifiedName {
    String^ get () abstract;
}
/** @property */
public abstract String get_AssemblyQualifiedName ()
public abstract function get
 AssemblyQualifiedName () : String

プロパティ
Type読み込み元であるアセンブリの名前を含む、Typeアセンブリ修飾名。現在のインスタンスジェネリック型パラメータを表す場合null 参照 (Visual Basic では Nothing)。

解説解説

入れ子になったクラスに対して共通言語ランタイムサポートするすべてのコンパイラ簡易名を生成しリフレクションが、照会されたときに次の規則に従って完全修飾名を生成します

たとえば、クラスアセンブリ修飾名は次のようになります

TopNamespace.SubNameSpace.ContainingClass+NestedClass, MyAssembly, Version=1.3.0.0,
 Culture=neutral, PublicKeyToken=b17a5c561934e089

TopNamespace.Sub+Namespace のように名前空間正符号 (+) が含まれている場合は、入れ子区切り文字として解釈されないように、正符号前にエスケープ文字 (\) を付ける必要がありますリフレクションは、この文字列次のように生成します

TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3.0.0,
 Culture=neutral, PublicKeyToken=b17a5c561934e089 

"++" は "\+\+"、"\" は "\\" となります

この完全限定名は永続化でき、後で Type読み込むために使用できますType検索して読み込むには、型名だけ、またはアセンブリ修飾型名いずれか指定して GetType使用します型名だけを指定して GetType使用した場合は、呼び出し元のアセンブリType だけが検索され次に System アセンブリ検索されます。アセンブリ修飾型名指定して GetType使用した場合は、任意のアセンブリ内の Type検索されます。

型名末尾には、その型に関する追加情報を示す文字追加できます。たとえば、その型が参照型か、ポインタ型か、配列型かなどを表す文字追加できますこのような末尾文字除いて型名だけを取得するには、t.GetElementType().ToString()使用しますt が型を示します

アセンブリ名を除くすべて型名コンポーネントで、スペースには意味がありますアセンブリ名では、区切り記号 ',' の前のスペースには意味がありますが、区切り記号 ',' の後のスペース無視されます。

ジェネリック型汎用引数はそれ自体アセンブリ名によって修飾されています。たとえば、MyGenericClass<int> (Visual Basic の場合MyGenericClass(Of Integer)) のアセンブリ修飾型名では、int が Int32 のアセンブリ修飾型名拡張されます。

現在の Type オブジェクトジェネリック パラメータ表している場合、このプロパティnull 参照 (Visual Basic では Nothing) を返します

使用例使用例

クラス関連付けられたアセンブリ名とその型の完全限定名を表示する例を次に示します

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

_Type.AssemblyQualifiedName プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

COM オブジェクトに、Type.AssemblyQualifiedName プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

ReadOnly Property AssemblyQualifiedName As
 String
Dim instance As _Type
Dim value As String

value = instance.AssemblyQualifiedName
string AssemblyQualifiedName { get; }
property String^ AssemblyQualifiedName {
    String^ get ();
}
/** @property */
String get_AssemblyQualifiedName ()
function get AssemblyQualifiedName () : String

プロパティ
Type読み込み元であるアセンブリの名前を含む、Typeアセンブリ修飾名。

解説解説

このプロパティは、アンマネージ コードからマネージ クラスアクセスするためのプロパティであるため、マネージ コードからは呼び出さないください

Type.AssemblyQualifiedName プロパティは、Type読み込み元であるアセンブリの名前を含む、Typeアセンブリ修飾名を取得します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「_Type.AssemblyQualifiedName」の関連用語

_Type.AssemblyQualifiedNameのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



_Type.AssemblyQualifiedNameのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS