AppDomain.ExecuteAssembly 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정한 파일에 포함된 어셈블리를 실행합니다.
오버로드
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.
주의
Use an overload that does not take an Evidence parameter
지정한 증명 정보, 인수, 해시 값 및 해시 알고리즘을 사용하여 지정한 파일에 포함된 어셈블리를 실행합니다.
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);
[System.Obsolete("Use an overload that does not take an Evidence parameter")]
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
[<System.Obsolete("Use an overload that does not take an Evidence parameter")>]
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.0 이상의 공용 언어 런타임이 현재 로드되어 있으며 assemblyFile
가 이후 버전으로 컴파일되었습니다.
언로드된 애플리케이션 도메인에서 작업이 시도됩니다.
어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.
assemblySecurity
이 null
가 아닙니다. 레거시 CAS 정책을 사용하지 않을 때는 assemblySecurity
는 null
이 되어야 합니다.
지정된 어셈블리에 진입점이 없습니다.
예제
다음 샘플에서는 서로 다른 두 도메인의 오버로드 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 Test {
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.
주의
Use an overload that does not take an Evidence parameter
지정한 증명 정보 및 인수를 사용하여 지정한 파일에 포함된 어셈블리를 실행합니다.
public:
virtual int ExecuteAssembly(System::String ^ assemblyFile, System::Security::Policy::Evidence ^ assemblySecurity, cli::array <System::String ^> ^ args);
public:
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);
[System.Obsolete("Use an overload that does not take an Evidence parameter")]
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
[<System.Obsolete("Use an overload that does not take an Evidence parameter")>]
member this.ExecuteAssembly : string * System.Security.Policy.Evidence * string[] -> int
[<System.Obsolete("Use an overload that does not take an Evidence parameter")>]
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.0 이상의 공용 언어 런타임이 현재 로드되어 있으며 assemblyFile
가 이후 버전으로 컴파일되었습니다.
언로드된 애플리케이션 도메인에서 작업이 시도됩니다.
어셈블리 또는 모듈이 서로 다른 두 증명 정보로 두 번 로드되었습니다.
assemblySecurity
이 null
가 아닙니다. 레거시 CAS 정책을 사용하지 않을 때는 assemblySecurity
는 null
이 되어야 합니다.
지정된 어셈블리에 진입점이 없습니다.
예제
다음 샘플에서는 서로 다른 두 도메인의 오버로드 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 Test {
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)
주의
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
는 유효한 어셈블리가 아닙니다.
또는
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 Test {
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)
주의
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.
주의
Use an overload that does not take an Evidence parameter
지정한 증명 정보를 사용하여 지정한 파일에 포함된 어셈블리를 실행합니다.
public:
virtual int ExecuteAssembly(System::String ^ assemblyFile, System::Security::Policy::Evidence ^ assemblySecurity);
public:
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);
[System.Obsolete("Use an overload that does not take an Evidence parameter")]
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
[<System.Obsolete("Use an overload that does not take an Evidence parameter")>]
member this.ExecuteAssembly : string * System.Security.Policy.Evidence -> int
[<System.Obsolete("Use an overload that does not take an Evidence parameter")>]
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.0 이상의 공용 언어 런타임이 현재 로드되어 있으며 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 Test {
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[])
지정한 인수를 사용하여 지정한 파일에 포함된 어셈블리를 실행합니다.
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
는 유효한 어셈블리가 아닙니다.
또는
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 Test {
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)
지정한 파일에 포함된 어셈블리를 실행합니다.
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
는 유효한 어셈블리가 아닙니다.
또는
버전 2.0 이상의 공용 언어 런타임이 현재 로드되어 있으며 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 Test {
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 사용합니다.