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 는 현재 로드된 런타임에 유효한 어셈블리가 아닙니다.

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.

assemblySecuritynull가 아닙니다. 레거시 CAS 정책을 사용하지 않을 때는 assemblySecuritynull이 되어야 합니다.

지정된 어셈블리에 진입점이 없습니다.

예제

다음 샘플에서는 두 개의 서로 다른 도메인에서 의 ExecuteAssembly 오버로드 중 하나를 사용하는 방법을 보여 줍니다.

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 . 메서드를 사용하여 어셈블리를 ExecuteAssemblyByName 로드하는 메서드를 사용하여 어셈블리를 Load 실행할 수도 있습니다.

적용 대상

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 는 현재 로드된 런타임에 유효한 어셈블리가 아닙니다.

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.

assemblySecuritynull가 아닙니다. 레거시 CAS 정책을 사용하지 않을 때는 assemblySecuritynull이 되어야 합니다.

지정된 어셈블리에 진입점이 없습니다.

예제

다음 샘플에서는 두 개의 서로 다른 도메인에서 의 ExecuteAssembly 오버로드 중 하나를 사용하는 방법을 보여 줍니다.

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 . 메서드를 사용하여 어셈블리를 ExecuteAssemblyByName 로드하는 메서드를 사용하여 어셈블리를 Load 실행할 수도 있습니다.

적용 대상

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

Source:
AppDomain.cs
Source:
AppDomain.cs
Source:
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);
public int ExecuteAssembly (string assemblyFile, string?[]? args, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm);
[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);
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
[<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
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 는 현재 로드된 런타임에 유효한 어셈블리가 아닙니다.

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.

지정된 어셈블리에 진입점이 없습니다.

예제

다음 샘플에서는 두 개의 서로 다른 도메인에서 의 ExecuteAssembly 오버로드 중 하나를 사용하는 방법을 보여 줍니다.

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

설명

주의

CAS(코드 액세스 보안)는 .NET Framework 및 .NET의 모든 버전에서 더 이상 사용되지 않습니다. 최신 버전의 .NET은 CAS 주석을 준수하지 않으며 CAS 관련 API를 사용하는 경우 오류가 발생합니다. 개발자는 보안 작업을 수행하는 대체 수단을 찾아야 합니다.

어셈블리는 .NET Framework 헤더에 지정된 진입점에서 실행되기 시작합니다.

이 메서드는 새 프로세스 또는 애플리케이션 도메인을 만들지 않습니다 및 진입점 메서드를 새 스레드에서 실행 되지 않습니다.

이 메서드는 메서드를 사용하여 어셈블리를 로드합니다 LoadFile . 메서드를 사용하여 어셈블리를 ExecuteAssemblyByName 로드하는 메서드를 사용하여 어셈블리를 Load 실행할 수도 있습니다.

적용 대상

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 는 현재 로드된 런타임에 유효한 어셈블리가 아닙니다.

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.

지정된 어셈블리에 진입점이 없습니다.

예제

다음 샘플에서는 두 개의 서로 다른 도메인에서 의 ExecuteAssembly 오버로드 중 하나를 사용하는 방법을 보여 줍니다.

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 헤더에 지정된 진입점에서 실행되기 시작합니다.

ExecuteAssembly 메서드는 새 프로세스 또는 애플리케이션 도메인을 만들지 않습니다 및 진입점 메서드를 새 스레드에서 실행 되지 않습니다.

이 메서드는 메서드를 사용하여 어셈블리를 로드합니다 LoadFile . 메서드를 사용하여 어셈블리를 ExecuteAssemblyByName 로드하는 메서드를 사용하여 어셈블리를 Load 실행할 수도 있습니다.

적용 대상

ExecuteAssembly(String, String[])

Source:
AppDomain.cs
Source:
AppDomain.cs
Source:
AppDomain.cs

지정한 인수를 사용하여 지정한 파일에 포함된 어셈블리를 실행합니다.

public:
 int ExecuteAssembly(System::String ^ assemblyFile, cli::array <System::String ^> ^ args);
public int ExecuteAssembly (string assemblyFile, 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[]

어셈블리의 진입점에 대한 인수입니다.

반환

어셈블리의 진입점에서 반환된 값입니다.

예외

assemblyFile이(가) null인 경우

assemblyFile 가 없는 경우

assemblyFile 는 현재 로드된 런타임에 유효한 어셈블리가 아닙니다.

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.

지정된 어셈블리에 진입점이 없습니다.

예제

다음 샘플에서는 두 개의 서로 다른 도메인에서 의 ExecuteAssembly 오버로드 중 하나를 사용하는 방법을 보여 줍니다.

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 . 메서드를 사용하여 어셈블리를 ExecuteAssemblyByName 로드하는 메서드를 사용하여 어셈블리를 Load 실행할 수도 있습니다.

적용 대상

ExecuteAssembly(String)

Source:
AppDomain.cs
Source:
AppDomain.cs
Source:
AppDomain.cs

지정한 파일에 포함된 어셈블리를 실행합니다.

public:
 int ExecuteAssembly(System::String ^ assemblyFile);
public:
 virtual int ExecuteAssembly(System::String ^ assemblyFile);
public int ExecuteAssembly (string assemblyFile);
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 는 현재 로드된 런타임에 유효한 어셈블리가 아닙니다.

언로드된 애플리케이션 도메인에서 작업이 시도됩니다.

어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.

지정된 어셈블리에 진입점이 없습니다.

예제

다음 샘플에서는 두 개의 서로 다른 도메인에서 의 ExecuteAssembly 오버로드 중 하나를 사용하는 방법을 보여 줍니다.

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 . 메서드를 사용하여 어셈블리를 ExecuteAssemblyByName 로드하는 메서드를 사용하여 어셈블리를 Load 실행할 수도 있습니다.

로드 및 실행할 을 AppDomain 만들려면 메서드를 CreateDomain 사용합니다.

적용 대상