This documentation is archived and is not being maintained.

Assembly.GetEntryAssembly Method

Gets the process executable in the default application domain. In other application domains, this is the first executable that was executed by AppDomain.ExecuteAssembly.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

public static Assembly GetEntryAssembly ()
public static Assembly GetEntryAssembly ()
public static function GetEntryAssembly () : Assembly
Not applicable.

Return Value

The Assembly that is the process executable in the default application domain, or the first executable that was executed by AppDomain.ExecuteAssembly. Can return a null reference (Nothing in Visual Basic) when called from unmanaged code.

The GetEntryAssembly method can return a null reference (Nothing in Visual Basic) when a managed assembly has been loaded from an unmanaged application. For example, if an unmanaged application creates an instance of a COM component written in C#, a call to the GetEntryAssembly method from the C# component returns null, because the entry point for the process was unmanaged code rather than a managed assembly.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Show: