To enhance interoperability between legacy systems and the common language runtime, the ErrorCode property stores an integer value (HRESULT) that identifies the error. User defined exceptions should never derive from ExternalException, and an ExternalException should never be thrown by user code. Use the specific exceptions that derive from ExternalException instead.

ExternalException uses the HRESULT E_FAIL which has the value 0x80004005.