Language

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

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

返品

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

属性

例外

assemblyFile は nullです。

assemblyFile が見つかりません。

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

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

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

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

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

適用対象

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[]

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

返品

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

実装

属性

例外

assemblyFile は nullです。

assemblyFile が見つかりません。

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

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

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

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

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

適用対象

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

ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs

注意事項

Code Access Security is not supported or honored by the runtime.

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

public:
 int ExecuteAssembly(System::String ^ assemblyFile, cli::array <System::String ^> ^ args, cli::array <System::Byte> ^ hashValue, System::Configuration::Assemblies::AssemblyHashAlgorithm hashAlgorithm);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public int ExecuteAssembly(string assemblyFile, string?[]? args, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile, string?[]? args, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
public int ExecuteAssembly(string assemblyFile, string[] args, byte[] hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
public int ExecuteAssembly(string assemblyFile, string?[]? args, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.ExecuteAssembly : string * string[] * byte[] * System.Configuration.Assemblies.AssemblyHashAlgorithm -> int
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
member this.ExecuteAssembly : string * string[] * byte[] * System.Configuration.Assemblies.AssemblyHashAlgorithm -> int
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

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

返品

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

属性

例外

assemblyFile は nullです。

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

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

返品

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

実装

属性

例外

assemblyFile は nullです。

assemblyFile が見つかりません。

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

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

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

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

適用対象

ExecuteAssembly(String, String[])

ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs

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

public:
 int ExecuteAssembly(System::String ^ assemblyFile, cli::array <System::String ^> ^ args);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile, string?[]? args);
public int ExecuteAssembly(string assemblyFile, string[] args);
public int ExecuteAssembly(string assemblyFile, string?[]? args);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
member this.ExecuteAssembly : string * string[] -> int
member this.ExecuteAssembly : string * string[] -> int
Public Function ExecuteAssembly (assemblyFile As String, args As String()) As Integer

パラメーター

assemblyFile
String

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

args
String[]

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

返品

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

属性

例外

assemblyFile は nullです。

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 ヘッダーで指定されたエントリ ポイントで実行を開始します。

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

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

適用対象

ExecuteAssembly(String)

ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs
ソース:
AppDomain.cs

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

public:
 int ExecuteAssembly(System::String ^ assemblyFile);
public:
 virtual int ExecuteAssembly(System::String ^ assemblyFile);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile);
public int ExecuteAssembly(string assemblyFile);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
member this.ExecuteAssembly : string -> int
member this.ExecuteAssembly : string -> int
abstract member ExecuteAssembly : string -> int
override this.ExecuteAssembly : string -> int
Public Function ExecuteAssembly (assemblyFile As String) As Integer

パラメーター

assemblyFile
String

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

返品

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

実装

属性

例外

assemblyFile は nullです。

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 ヘッダーで指定されたエントリ ポイントで実行を開始します。

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

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

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

適用対象