Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

Marshal.GetExceptionCode Method

Note: This API is now obsolete.

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

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

[ObsoleteAttribute("GetExceptionCode() may be unavailable in future releases.")]
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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Obsolete (compiler warning) in 4.6

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Obsolete (compiler warning) in Windows Phone 8.1

Portable Class Library

Supported in: Portable Class Library

  • SecurityCriticalAttribute 

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

Show:
© 2015 Microsoft