Gets the assembly that contains the code that is currently executing.
Assembly: mscorlib (in mscorlib.dll)
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.
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 method to show that it returns an Assembly object that represents the same assembly.
.NET FrameworkSupported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
XNA FrameworkSupported in: 3.0, 2.0, 1.0
Portable Class LibrarySupported in: Portable Class Library
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8