GetExceptionCode Method
Collapse the table of content
Expand the table of content

Marshal.GetExceptionCode Method ()


Retrieves a code that identifies the type of the exception that occurred.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

public static int GetExceptionCode()

Return Value

Type: System.Int32

The type of the exception.

GetExceptionCode is exposed for compiler support of structured exception handling (SEH) only. If this method is called before an exception is thrown, it returns 0x0.


requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft