System.AppDomain.ExecuteAssembly Method

Executes the assembly contained in the specified file.

Syntax

public int ExecuteAssembly (string assemblyFile)

Parameters

assemblyFile
The name of the file that contains the assembly to execute.

Returns

The value returned by the entry point of the assembly.

Remarks

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.

This method loads assemblies using the erload:System.Reflection.Assembly.LoadFile method. You can also execute assemblies using the erload:System.AppDomain.ExecuteAssemblyByName method, which loads assemblies using the erload:System.Reflection.Assembly.Load method.

To create the AppDomain to load and execute, use the AppDomain.CreateDomain(string, System.Security.Policy.Evidence) method.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0