AppDomain.ExecuteAssembly メソッド

定義

指定したファイルに含まれるアセンブリを実行します。

オーバーロード

名前 説明
ExecuteAssembly(String, Evidence, String[], Byte[], AssemblyHashAlgorithm)
古い.

指定した証拠、引数、ハッシュ値、およびハッシュ アルゴリズムを使用して、指定したファイルに含まれるアセンブリを実行します。

ExecuteAssembly(String, Evidence, String[])
古い.

指定した証拠と引数を使用して、指定したファイルに含まれるアセンブリを実行します。

ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm)

指定した引数、ハッシュ値、およびハッシュ アルゴリズムを使用して、指定したファイルに含まれるアセンブリを実行します。

ExecuteAssembly(String, Evidence)
古い.

指定した証拠を使用して、指定したファイルに含まれるアセンブリを実行します。

ExecuteAssembly(String, String[])

指定した引数を使用して、指定したファイルに含まれるアセンブリを実行します。

ExecuteAssembly(String)

指定したファイルに含まれるアセンブリを実行します。

ExecuteAssembly(String, Evidence, String[], Byte[], AssemblyHashAlgorithm)

注意事項

Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

指定した証拠、引数、ハッシュ値、およびハッシュ アルゴリズムを使用して、指定したファイルに含まれるアセンブリを実行します。

public:
 int ExecuteAssembly(System::String ^ assemblyFile, System::Security::Policy::Evidence ^ assemblySecurity, cli::array <System::String ^> ^ args, cli::array <System::Byte> ^ hashValue, System::Configuration::Assemblies::AssemblyHashAlgorithm hashAlgorithm);
public int ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args, byte[] hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
[System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public int ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args, byte[] hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
member this.ExecuteAssembly : string * System.Security.Policy.Evidence * string[] * byte[] * System.Configuration.Assemblies.AssemblyHashAlgorithm -> int
[<System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
member this.ExecuteAssembly : string * System.Security.Policy.Evidence * string[] * byte[] * System.Configuration.Assemblies.AssemblyHashAlgorithm -> int
Public Function ExecuteAssembly (assemblyFile As String, assemblySecurity As Evidence, args As String(), hashValue As Byte(), hashAlgorithm As AssemblyHashAlgorithm) As Integer

パラメーター

assemblyFile
String

実行するアセンブリを含むファイルの名前。

assemblySecurity
Evidence

アセンブリに対して提供された証拠。

args
String[]

アセンブリのエントリ ポイントの引数。

hashValue
Byte[]

計算されたハッシュ コードの値を表します。

hashAlgorithm
AssemblyHashAlgorithm

アセンブリ マニフェストで使用されるハッシュ アルゴリズムを表します。

返品

アセンブリのエントリ ポイントによって返される値。

属性

例外

assemblyFilenullです。

assemblyFile が見つかりません。

assemblyFile は、現在読み込まれているランタイムの有効なアセンブリではありません。

アンロードされたアプリケーション ドメインに対して操作が試行されます。

アセンブリまたはモジュールが、2 つの異なる証拠と共に 2 回読み込まれました。

assemblySecuritynullされていません。 レガシ CAS ポリシーが有効になっていない場合は、 assemblySecuritynullする必要があります。

指定したアセンブリにはエントリ ポイントがありません。

適用対象

ExecuteAssembly(String, Evidence, String[])

注意事項

Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

指定した証拠と引数を使用して、指定したファイルに含まれるアセンブリを実行します。

public:
 virtual int ExecuteAssembly(System::String ^ assemblyFile, System::Security::Policy::Evidence ^ assemblySecurity, cli::array <System::String ^> ^ args);
public int ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args);
[System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public int ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args);
abstract member ExecuteAssembly : string * System.Security.Policy.Evidence * string[] -> int
override this.ExecuteAssembly : string * System.Security.Policy.Evidence * string[] -> int
[<System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
abstract member ExecuteAssembly : string * System.Security.Policy.Evidence * string[] -> int
override this.ExecuteAssembly : string * System.Security.Policy.Evidence * string[] -> int
Public Function ExecuteAssembly (assemblyFile As String, assemblySecurity As Evidence, args As String()) As Integer

パラメーター

assemblyFile
String

実行するアセンブリを含むファイルの名前。

assemblySecurity
Evidence

アセンブリに対して提供された証拠。

args
String[]

アセンブリのエントリ ポイントの引数。

返品

アセンブリのエントリ ポイントによって返される値。

実装

属性

例外

assemblyFilenullです。

assemblyFile が見つかりません。

assemblyFile は、現在読み込まれているランタイムの有効なアセンブリではありません。

アンロードされたアプリケーション ドメインに対して操作が試行されます。

アセンブリまたはモジュールが、2 つの異なる証拠と共に 2 回読み込まれました。

assemblySecuritynullされていません。 レガシ CAS ポリシーが有効になっていない場合は、 assemblySecuritynullする必要があります。

指定したアセンブリにはエントリ ポイントがありません。

適用対象

ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm)

指定した引数、ハッシュ値、およびハッシュ アルゴリズムを使用して、指定したファイルに含まれるアセンブリを実行します。

public:
 int ExecuteAssembly(System::String ^ assemblyFile, cli::array <System::String ^> ^ args, cli::array <System::Byte> ^ hashValue, System::Configuration::Assemblies::AssemblyHashAlgorithm hashAlgorithm);
public int ExecuteAssembly(string assemblyFile, string[] args, byte[] hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
member this.ExecuteAssembly : string * string[] * byte[] * System.Configuration.Assemblies.AssemblyHashAlgorithm -> int
Public Function ExecuteAssembly (assemblyFile As String, args As String(), hashValue As Byte(), hashAlgorithm As AssemblyHashAlgorithm) As Integer

パラメーター

assemblyFile
String

実行するアセンブリを含むファイルの名前。

args
String[]

アセンブリのエントリ ポイントの引数。

hashValue
Byte[]

計算されたハッシュ コードの値を表します。

hashAlgorithm
AssemblyHashAlgorithm

アセンブリ マニフェストで使用されるハッシュ アルゴリズムを表します。

返品

アセンブリのエントリ ポイントによって返される値。

例外

assemblyFilenullです。

assemblyFile が見つかりません。

assemblyFile は、現在読み込まれているランタイムの有効なアセンブリではありません。

アンロードされたアプリケーション ドメインに対して操作が試行されます。

アセンブリまたはモジュールが、2 つの異なる証拠と共に 2 回読み込まれました。

指定したアセンブリにはエントリ ポイントがありません。

適用対象

ExecuteAssembly(String, Evidence)

注意事項

Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

指定した証拠を使用して、指定したファイルに含まれるアセンブリを実行します。

public:
 virtual int ExecuteAssembly(System::String ^ assemblyFile, System::Security::Policy::Evidence ^ assemblySecurity);
public int ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity);
[System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public int ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity);
abstract member ExecuteAssembly : string * System.Security.Policy.Evidence -> int
override this.ExecuteAssembly : string * System.Security.Policy.Evidence -> int
[<System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of ExecuteAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
abstract member ExecuteAssembly : string * System.Security.Policy.Evidence -> int
override this.ExecuteAssembly : string * System.Security.Policy.Evidence -> int
Public Function ExecuteAssembly (assemblyFile As String, assemblySecurity As Evidence) As Integer

パラメーター

assemblyFile
String

実行するアセンブリを含むファイルの名前。

assemblySecurity
Evidence

アセンブリを読み込むための証拠。

返品

アセンブリのエントリ ポイントによって返される値。

実装

属性

例外

assemblyFilenullです。

assemblyFile が見つかりません。

assemblyFile は、現在読み込まれているランタイムの有効なアセンブリではありません。

アンロードされたアプリケーション ドメインに対して操作が試行されます。

アセンブリまたはモジュールが、2 つの異なる証拠と共に 2 回読み込まれました。

指定したアセンブリにはエントリ ポイントがありません。

適用対象

ExecuteAssembly(String, String[])

指定した引数を使用して、指定したファイルに含まれるアセンブリを実行します。

public:
 int ExecuteAssembly(System::String ^ assemblyFile, cli::array <System::String ^> ^ args);
public int ExecuteAssembly(string assemblyFile, string[] args);
member this.ExecuteAssembly : string * string[] -> int
Public Function ExecuteAssembly (assemblyFile As String, args As String()) As Integer

パラメーター

assemblyFile
String

実行するアセンブリを含むファイルの名前。

args
String[]

アセンブリのエントリ ポイントの引数。

返品

アセンブリのエントリ ポイントによって返される値。

例外

assemblyFilenullです。

assemblyFile が見つかりません。

assemblyFile は、現在読み込まれているランタイムの有効なアセンブリではありません。

アンロードされたアプリケーション ドメインに対して操作が試行されます。

アセンブリまたはモジュールが、2 つの異なる証拠と共に 2 回読み込まれました。

指定したアセンブリにはエントリ ポイントがありません。

次の例では、2 つの異なるドメインで ExecuteAssembly のオーバーロードの 1 つを使用する方法を示します。

int main()
{
   AppDomain^ currentDomain = AppDomain::CurrentDomain;
   AppDomain^ otherDomain = AppDomain::CreateDomain( "otherDomain" );
   currentDomain->ExecuteAssembly( "MyExecutable.exe" );
   
   // Prints S"MyExecutable running on [default]"
   otherDomain->ExecuteAssembly( "MyExecutable.exe" );
   
   // Prints S"MyExecutable running on otherDomain"
}
class ExecuteAssemblySnippet {
   public static void Main() {
      AppDomain currentDomain = AppDomain.CurrentDomain;
      AppDomain otherDomain = AppDomain.CreateDomain("otherDomain");

      currentDomain.ExecuteAssembly("MyExecutable.exe");
      // Prints "MyExecutable running on [default]"

      otherDomain.ExecuteAssembly("MyExecutable.exe");
      // Prints "MyExecutable running on otherDomain"
   }
}
open System

let currentDomain = AppDomain.CurrentDomain
let otherDomain = AppDomain.CreateDomain "otherDomain"

currentDomain.ExecuteAssembly "MyExecutable.exe"
// Prints "MyExecutable running on [default]"

otherDomain.ExecuteAssembly "MyExecutable.exe"
// Prints "MyExecutable running on otherDomain"
Module Test

   Sub Main()
      Dim currentDomain As AppDomain = AppDomain.CurrentDomain
      Dim otherDomain As AppDomain = AppDomain.CreateDomain("otherDomain")
      
      currentDomain.ExecuteAssembly("MyExecutable.exe")
      ' Prints "MyExecutable running on [default]"

      otherDomain.ExecuteAssembly("MyExecutable.exe")
      ' Prints "MyExecutable running on otherDomain"
   End Sub

End Module 'Test

注釈

アセンブリは、.NET Framework ヘッダーで指定されたエントリ ポイントで実行を開始します。

このメソッドは、新しいプロセスまたはアプリケーション ドメインを作成せず、新しいスレッドでエントリ ポイント メソッドを実行しません。

このメソッドは、 LoadFile メソッドを使用してアセンブリを読み込みます。 Load メソッドを使用してアセンブリを読み込むExecuteAssemblyByName メソッドを使用してアセンブリを実行することもできます。

適用対象

ExecuteAssembly(String)

指定したファイルに含まれるアセンブリを実行します。

public:
 virtual int ExecuteAssembly(System::String ^ assemblyFile);
public:
 int ExecuteAssembly(System::String ^ assemblyFile);
public int ExecuteAssembly(string assemblyFile);
abstract member ExecuteAssembly : string -> int
override this.ExecuteAssembly : string -> int
member this.ExecuteAssembly : string -> int
Public Function ExecuteAssembly (assemblyFile As String) As Integer

パラメーター

assemblyFile
String

実行するアセンブリを含むファイルの名前。

返品

アセンブリのエントリ ポイントによって返される値。

実装

例外

assemblyFilenullです。

assemblyFile が見つかりません。

assemblyFile は、現在読み込まれているランタイムの有効なアセンブリではありません。

アンロードされたアプリケーション ドメインに対して操作が試行されます。

アセンブリまたはモジュールが、2 つの異なる証拠と共に 2 回読み込まれました。

指定したアセンブリにはエントリ ポイントがありません。

次の例では、2 つの異なるドメインで ExecuteAssembly のオーバーロードの 1 つを使用する方法を示します。

int main()
{
   AppDomain^ currentDomain = AppDomain::CurrentDomain;
   AppDomain^ otherDomain = AppDomain::CreateDomain( "otherDomain" );
   currentDomain->ExecuteAssembly( "MyExecutable.exe" );
   
   // Prints S"MyExecutable running on [default]"
   otherDomain->ExecuteAssembly( "MyExecutable.exe" );
   
   // Prints S"MyExecutable running on otherDomain"
}
class ExecuteAssemblySnippet {
   public static void Main() {
      AppDomain currentDomain = AppDomain.CurrentDomain;
      AppDomain otherDomain = AppDomain.CreateDomain("otherDomain");

      currentDomain.ExecuteAssembly("MyExecutable.exe");
      // Prints "MyExecutable running on [default]"

      otherDomain.ExecuteAssembly("MyExecutable.exe");
      // Prints "MyExecutable running on otherDomain"
   }
}
open System

let currentDomain = AppDomain.CurrentDomain
let otherDomain = AppDomain.CreateDomain "otherDomain"

currentDomain.ExecuteAssembly "MyExecutable.exe"
// Prints "MyExecutable running on [default]"

otherDomain.ExecuteAssembly "MyExecutable.exe"
// Prints "MyExecutable running on otherDomain"
Module Test

   Sub Main()
      Dim currentDomain As AppDomain = AppDomain.CurrentDomain
      Dim otherDomain As AppDomain = AppDomain.CreateDomain("otherDomain")
      
      currentDomain.ExecuteAssembly("MyExecutable.exe")
      ' Prints "MyExecutable running on [default]"

      otherDomain.ExecuteAssembly("MyExecutable.exe")
      ' Prints "MyExecutable running on otherDomain"
   End Sub

End Module 'Test

注釈

アセンブリは、.NET Framework ヘッダーで指定されたエントリ ポイントで実行を開始します。

このメソッドは、新しいプロセスまたはアプリケーション ドメインを作成せず、新しいスレッドでエントリ ポイント メソッドを実行しません。

このメソッドは、 LoadFile メソッドを使用してアセンブリを読み込みます。 Load メソッドを使用してアセンブリを読み込むExecuteAssemblyByName メソッドを使用してアセンブリを実行することもできます。

読み込んで実行する AppDomain を作成するには、 CreateDomain メソッドを使用します。

適用対象