Assembly.GetExecutingAssembly Method ()

 

Gets the assembly that contains the code that is currently executing.

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

static member GetExecutingAssembly : unit -> Assembly

Return Value

Type: System.Reflection.Assembly

The assembly that contains the code that is currently executing.

For performance reasons, you should call this method only when you do not know at design time what assembly is currently executing. The recommended way to retrieve an Assembly object that represents the current assembly is to use the Type.Assembly property of a type found in the assembly, as the following example illustrates.

No code example is currently available or this language may not be supported.

To get the assembly that contains the method that called the currently executing code, use GetCallingAssembly.

The following example uses the Type.Assembly property to get the currently executing assembly based on a type contained in that assembly. It also calls the GetExecutingAssembly method to show that it returns an Assembly object that represents the same assembly.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: