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

マニフェストを格納している読み込み済みファイルの場所。読み込み済みファイルがシャドウ コピーされている場合、この場所はシャドウ コピーされた後のファイルの場所です。Load(Byte[]) メソッド オーバーロードを使用したときなど、アセンブリがバイト配列から読み込まれた場合に返される値は、空の文字列 ("") です。


マニフェストを格納している読み込み済みファイルの場所を表示する例を次に示します。
Dim SampleAssembly As [Assembly] ' Instantiate a target object. Dim Integer1 As New Int32() Dim Type1 As Type ' Set the Type instance to the target class type. Type1 = Integer1.GetType() ' Instantiate an Assembly class to the assembly housing the Integer type. SampleAssembly = [Assembly].GetAssembly(Integer1.GetType()) ' Display the physical location of the assembly containing the manifest. Console.WriteLine(("Location=" + SampleAssembly.Location)) End Sub 'Snippet3
Assembly SampleAssembly; // Instantiate a target object. Int32 Integer1 = new Int32(); Type Type1; // Set the Type instance to the target class type. Type1 = Integer1.GetType(); // Instantiate an Assembly class to the assembly housing the Integer type. SampleAssembly = Assembly.GetAssembly(Integer1.GetType()); // Display the physical location of the assembly containing the manifest. Console.WriteLine("Location=" + SampleAssembly.Location);
Assembly^ SampleAssembly; // Instantiate a target object. Int32 Integer1(0); Type^ Type1; // Set the Type instance to the target class type. Type1 = Integer1.GetType(); // Instantiate an Assembly class to the assembly housing the Integer type. SampleAssembly = Assembly::GetAssembly( Integer1.GetType() ); // Display the physical location of the assembly containing the manifest. Console::WriteLine( "Location= {0}", SampleAssembly->Location );
var SampleAssembly : Assembly; // Instantiate a target object. var Integer1 : Int32 = 0; var Type1 : Type; // Set the Type instance to the target class type. Type1 = Integer1.GetType(); // Instantiate an Assembly class to the assembly housing the Integer type. SampleAssembly = Assembly.GetAssembly(Integer1.GetType()); // Display the physical location of the assembly containing the manifest. Console.WriteLine("Location=" + SampleAssembly.Location);


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

マニフェストを格納している読み込み済みファイルの場所。読み込み済みファイルがシャドウ コピーされている場合、この場所はシャドウ コピーされた後のファイルの場所です。Load メソッド オーバーロードを使用したときなど、アセンブリがバイト配列から読み込まれた場合に返される値は、空の文字列 ("") です。

このメソッドは、アンマネージ コードからマネージ クラスにアクセスするためのメソッドであるため、マネージ コードからは呼び出さないでください。
Location プロパティは、マニフェストを格納している読み込み済みファイルのパスまたは UNC (Universal Naming Convention) の場所を取得します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- _Assembly.Locationのページへのリンク