共用方式為


Assembly.GetExecutingAssembly Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Shared Function GetExecutingAssembly As Assembly
[SecuritySafeCriticalAttribute]
public static Assembly GetExecutingAssembly()

Return Value

Type: System.Reflection.Assembly
A Assembly representing the assembly that contains the code that is currently executing.

Remarks

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.