AppDomain.ExecuteAssembly Method (String, String(), Byte(), AssemblyHashAlgorithm)
Executes the assembly contained in the specified file, using the specified arguments, hash value, and hash algorithm.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Function ExecuteAssembly ( _ assemblyFile As String, _ args As String(), _ hashValue As Byte(), _ hashAlgorithm As AssemblyHashAlgorithm _ ) As Integer
- Type: System.String
The name of the file that contains the assembly to execute.
- Type: System.String()
The arguments to the entry point of the assembly.
- Type: System.Byte()
Represents the value of the computed hash code.
- Type: System.Configuration.Assemblies.AssemblyHashAlgorithm
Represents the hash algorithm used by the assembly manifest.
Return ValueType: System.Int32
The value that is returned by the entry point of the assembly.
assemblyFile is Nothing.
assemblyFile is not found.
assemblyFile is not a valid assembly.
assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded.
The operation is attempted on an unloaded application domain.
An assembly or module was loaded twice with two different evidences.
The specified assembly has no entry point.
The assembly begins executing at the entry point specified in the .NET Framework header.
This method does not create a new process or application domain, and it does not execute the entry point method on a new thread.
The following sample demonstrates using one of the overloads of ExecuteAssembly on two different domains.
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 'Main End Module 'Test
for reading a URI that does not begin with "file://".
to execute a console application. Associated enumeration: PermissionState.Unrestricted.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.