CROSS-REFERENCE: Microsoft.NET error codes and standard exceptions table

Brief introduction

This table is designed to help Windows run-time application error code cross-reference to the Microsoft.NET standard exceptions that can be used as part of the application exception handling techniques.

Chart

.NET Exception (Namespace)

HRESULT(s) - symbolic

HRESULT(s) - raw

AccessViolationException

E_POINTER

0x80004003

AmbiguousMatchException (System.Reflection)

COR_E_AMBIGUOUSMATCH

0x8000211d

ApplicationException

COR_E_APPLICATION

0x80131600

AppDomainUnloadedException

COR_E_APPDOMAINUNLOADED

0x80131014

ArithmeticException

COR_E_ARITHMETIC

0x80070216

ArgumentException

COR_E_ARGUMENT

0x80070057

ArgumentNullException

E_POINTER

0x80004003

ArgumentOutOfRangeException

COR_E_ARGUMENTOUTOFRANGE

0x80131502

ERROR_NO_UNICODE_TRANSLATION

0x80070459

ArrayTypeMismatchException

COR_E_ARRAYTYPEMISMATCH

0x80131503

BadImageFormatException

COR_E_BADIMAGEFORMAT

0x8007000b

CLDB_E_FILE_OLDVER

0x80131107

CLDB_E_INDEX_NOTFOUND

0x80131124

CLDB_E_FILE_CORRUPT

0x8013110e

COR_E_NEWER_RUNTIME

0x8013101b

COR_E_ASSEMBLYEXPECTED

0x80131018

ERROR_BAD_EXE_FORMAT

0x800700c1

ERROR_EXE_MARKED_INVALID

0x800700c0

CORSEC_E_INVALID_IMAGE_FORMAT

0x8013141d

ERROR_NOACCESS

0x800703e6

ERROR_INVALID_ORDINAL

0x800700b6

ERROR_INVALID_DLL

0x80070482

ERROR_FILE_CORRUPT

0x80070570

COR_E_LOADING_REFERENCE_ASSEMBLY

0x80131058

META_E_BAD_SIGNATURE

0x80131192

CannotUnloadAppDomainException

COR_E_CANNOTUNLOADAPPDOMAIN

0x80131015

ContractException (System.Diagnostics.Contracts)

COR_E_CODECONTRACTFAILED

0x80131542

ContextMarshalException (System)

COR_E_CONTEXTMARSHAL

0x80131504

CustomAttributeFormatException (System.Reflection)

COR_E_CUSTOMATTRIBUTEFORMAT

0x80131605

CryptographicException (System.Security.Cryptography)

CORSEC_E_CRYPTO

0x80131430

CryptographicUnexpectedOperationException (System.Security.Cryptography)

CORSEC_E_CRYPTO_UNEX_OPER

0x80131431

DataMisalignedException

COR_E_DATAMISALIGNED

0x80131541

DirectoryNotFoundException (System.IO)

COR_E_DIRECTORYNOTFOUND

0x80070003

STG_E_PATHNOTFOUND

0x80030003

CTL_E_PATHNOTFOUND

0x800a004c

DivideByZeroException

COR_E_DIVIDEBYZERO

0x80020012

CTL_E_DIVISIONBYZERO

0x800a000b

DllNotFoundException

COR_E_DLLNOTFOUND

0x80131524

DuplicateWaitObjectException

COR_E_DUPLICATEWAITOBJECT

0x80131529

EndOfStreamException (System.IO)

COR_E_ENDOFSTREAM

0x80070026

EntryPointNotFoundException

COR_E_ENTRYPOINTNOTFOUND

0x80131523

Exception

COR_E_EXCEPTION

0x80131500

ExecutionEngineException

COR_E_EXECUTIONENGINE

0x80131506

FieldAccessException

COR_E_FIELDACCESS

0x80131507

FileLoadException (System.IO)

COR_E_FILELOAD

0x80131621

FUSION_E_INVALID_PRIVATE_ASM_LOCATION

0x80131041

FUSION_E_SIGNATURE_CHECK_FAILED

0x80131045

FUSION_E_LOADFROM_BLOCKED

0x80131051

FUSION_E_CACHEFILE_FAILED

0x80131052

FUSION_E_ASM_MODULE_MISSING

0x80131042

FUSION_E_INVALID_NAME

0x80131047

FUSION_E_PRIVATE_ASM_DISALLOWED

0x80131044

FUSION_E_HOST_GAC_ASM_MISMATCH

0x80131050

COR_E_MODULE_HASH_CHECK_FAILED

0x80131039

FUSION_E_REF_DEF_MISMATCH

0x80131040

SECURITY_E_INCOMPATIBLE_SHARE

0x80131401

SECURITY_E_INCOMPATIBLE_EVIDENCE

0x80131403

SECURITY_E_UNVERIFIABLE

0x80131402

COR_E_FIXUPSINEXE

0x80131019

ERROR_TOO_MANY_OPEN_FILES

0x80070004

ERROR_SHARING_VIOLATION

0x80070020

ERROR_LOCK_VIOLATION

0x80070021

ERROR_OPEN_FAILED

0x8007006e

ERROR_DISK_CORRUPT

0x80070571

ERROR_UNRECOGNIZED_VOLUME

0x800703ed

ERROR_DLL_INIT_FAILED

0x8007045a

FUSION_E_CODE_DOWNLOAD_DISABLED

0x80131048

CORSEC_E_MISSING_STRONGNAME

0x8013141b

MSEE_E_ASSEMBLYLOADINPROGRESS

0x80131016

ERROR_FILE_INVALID

0x800703ee

FileNotFoundException (System.IO)

ERROR_FILE_NOT_FOUND

0x80070002

ERROR_MOD_NOT_FOUND

0x8007007e

ERROR_INVALID_NAME

0x8007007b

CTL_E_FILENOTFOUND

0x800a0035

ERROR_PATH_NOT_FOUND

0x80070003

ERROR_BAD_NET_NAME

0x80070043

ERROR_BAD_NETPATH

0x80070035

ERROR_NOT_READY

0x80070015

ERROR_WRONG_TARGET_NAME

0x80070574

INET_E_UNKNOWN_PROTOCOL

0x800c000d

INET_E_CONNECTION_TIMEOUT

0x800c000b

INET_E_CANNOT_CONNECT

0x800c0004

INET_E_RESOURCE_NOT_FOUND

0x800c0005

INET_E_OBJECT_NOT_FOUND

0x800c0006

INET_E_DOWNLOAD_FAILURE

0x800c0008

INET_E_DATA_NOT_AVAILABLE

0x800c0007

ERROR_DLL_NOT_FOUND

0x80070485

CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW

0x80132000

CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH

0x80132001

CLR_E_BIND_ASSEMBLY_NOT_FOUND

0x80132004

FormatException

COR_E_FORMAT

0x80131537

IndexOutOfRangeException

COR_E_INDEXOUTOFRANGE

0x80131508

InsufficientExecutionStackException

COR_E_INSUFFICIENTEXECUTIONSTACK

0x80131578

InvalidCastException

COR_E_INVALIDCAST

0x80004002

InvalidComObjectException (System.Runtime.InteropServices)

COR_E_INVALIDCOMOBJECT

0x80131527

InvalidFilterCriteriaException (System.Reflection)

COR_E_INVALIDFILTERCRITERIA

0x80131601

InvalidOleVariantTypeException (System.Runtime.InteropServices)

COR_E_INVALIDOLEVARIANTTYPE

0x80131531

InvalidOperationException

COR_E_INVALIDOPERATION

0x80131509

InvalidProgramException

COR_E_INVALIDPROGRAM

0x8013153a

IOException (System.IO)

COR_E_IO

0x80131620

CTL_E_DEVICEIOERROR

0x800a0039

IsolatedStorageException (System.IO.IsolatedStorage)

ISS_E_ISOSTORE

0x80131450

ISS_E_OPEN_STORE_FILE

0x80131460

ISS_E_OPEN_FILE_MAPPING

0x80131461

ISS_E_MAP_VIEW_OF_FILE

0x80131462

ISS_E_GET_FILE_SIZE

0x80131463

ISS_E_CREATE_MUTEX

0x80131464

ISS_E_LOCK_FAILED

0x80131465

ISS_E_FILE_WRITE

0x80131466

ISS_E_SET_FILE_POINTER

0x80131467

ISS_E_CREATE_DIR

0x80131468

ISS_E_CORRUPTED_STORE_FILE

0x80131480

ISS_E_STORE_VERSION

0x80131481

ISS_E_FILE_NOT_MAPPED

0x80131482

ISS_E_BLOCK_SIZE_TOO_SMALL

0x80131483

ISS_E_ALLOC_TOO_LARGE

0x80131484

ISS_E_USAGE_WILL_EXCEED_QUOTA

0x80131485

ISS_E_TABLE_ROW_NOT_FOUND

0x80131486

ISS_E_DEPRECATE

0x801314a0

ISS_E_CALLER

0x801314a1

ISS_E_PATH_LENGTH

0x801314a2

ISS_E_MACHINE

0x801314a3

ISS_E_STORE_NOT_OPEN

0x80131469

ISS_E_MACHINE_DACL

0x801314a4

MarshalDirectiveException (System.Runtime.InteropServices)

COR_E_MARSHALDIRECTIVE

0x80131535

MethodAccessException

COR_E_METHODACCESS

0x80131510

META_E_CA_FRIENDS_SN_REQUIRED

0x801311e6

MemberAccessException

COR_E_MEMBERACCESS

0x8013151a

MissingFieldException

COR_E_MISSINGFIELD

0x80131511

MissingManifestResourceException (System.Resources)

COR_E_MISSINGMANIFESTRESOURCE

0x80131532

MissingMemberException

COR_E_MISSINGMEMBER

0x80131512

MissingMethodException

COR_E_MISSINGMETHOD

0x80131513

MulticastNotSupportedException

COR_E_MULTICASTNOTSUPPORTED

0x80131514

NotFiniteNumberException

COR_E_NOTFINITENUMBER

0x80131528

NotImplementedException

E_NOTIMPL

0x80004001

NotSupportedException

COR_E_NOTSUPPORTED

0x80131515

NullReferenceException

COR_E_NULLREFERENCE

0x80004003

ObjectDisposedException

COR_E_OBJECTDISPOSED

0x80131622

RO_E_CLOSED

0x80000013

OperationCanceledException

COR_E_OPERATIONCANCELED

0x8013153b

OutOfMemoryException

E_OUTOFMEMORY

0x8007000e

CTL_E_OUTOFMEMORY

0x800a0007

OverflowException

COR_E_OVERFLOW

0x80131516

CTL_E_OVERFLOW

0x800a0006

PathTooLongException (System.IO)

COR_E_PATHTOOLONG

0x800700ce

PlatformNotSupportedException

COR_E_PLATFORMNOTSUPPORTED

0x80131539

System.RankException

COR_E_RANK

0x80131517

ReflectionTypeLoadException (System.Reflection)

COR_E_REFLECTIONTYPELOAD

0x80131602

RemotingException (System.Runtime.Remoting)

COR_E_REMOTING

0x8013150b

RuntimeWrappedException (System.Runtime.CompilerServices)

COR_E_RUNTIMEWRAPPED

0x8013153e

ServerException (System.Runtime.Remoting)

COR_E_SERVER

0x8013150e

SecurityException (System.Security)

COR_E_SECURITY

0x8013150a

CORSEC_E_INVALID_STRONGNAME

0x8013141a

CTL_E_PERMISSIONDENIED

0x800a0046

CORSEC_E_INVALID_PUBLICKEY

0x8013141e

CORSEC_E_SIGNATURE_MISMATCH

0x80131420

SafeArrayRankMismatchException System.Runtime.InteropServices)

COR_E_SAFEARRAYRANKMISMATCH

0x80131538

SafeArrayTypeMismatchException (System.Runtime.InteropServices)

COR_E_SAFEARRAYTYPEMISMATCH

0x80131533

SerializationException (System.Runtime.Serialization)

COR_E_SERIALIZATION

0x8013150c

StackOverflowException

COR_E_STACKOVERFLOW

0x800703e9

CTL_E_OUTOFSTACKSPACE

0x800a001c

SynchronizationLockException (System.Threading)

COR_E_SYNCHRONIZATIONLOCK

0x80131518

SystemException

COR_E_SYSTEM

0x80131501

TargetException (System.Reflection)

COR_E_TARGET

0x80131603

TargetInvocationException (System.Reflection)

COR_E_TARGETINVOCATION

0x80131604

TargetParameterCountException (System.Reflection)

COR_E_TARGETPARAMCOUNT

0x8002000e

ThreadAbortException (System.Threading)

COR_E_THREADABORTED

0x80131530

ThreadInterruptedException (System.Threading)

COR_E_THREADINTERRUPTED

0x80131519

ThreadStateException (System.Threading)

COR_E_THREADSTATE

0x80131520

ThreadStartException (System.Threading)

COR_E_THREADSTART

0x80131525

TypeAccessException

COR_E_TYPEACCESS

0x80131543

TypeInitializationException

COR_E_TYPEINITIALIZATION

0x80131534

TypeLoadException

COR_E_TYPELOAD

0x80131522

RO_E_METADATA_NAME_NOT_FOUND

0x8000000f

CLR_E_BIND_TYPE_NOT_FOUND

0x80132005

TypeUnloadedException

COR_E_TYPEUNLOADED

0x80131013

UnauthorizedAccessException

COR_E_UNAUTHORIZEDACCESS

0x80070005

CTL_E_PATHFILEACCESSERROR

0x800a004b

VerificationException (System.Security)

COR_E_VERIFICATION

0x8013150d

PolicyException (System.Security.Policy)

CORSEC_E_POLICY_EXCEPTION

0x80131416

CORSEC_E_NO_EXEC_PERM

0x80131418

CORSEC_E_MIN_GRANT_FAIL

0x80131417

XmlSyntaxException (System.Security)

CORSEC_E_XMLSYNTAX

0x80131419

COMException (System.Runtime.InteropServices)

E_FAIL

0x80004005

ExternalException (System.Runtime.InteropServices)

E_FAIL

0x80004005

SEHException (System.Runtime.InteropServices)

E_FAIL

0x80004005

ElementNotAvailableException (Windows.UI.Xaml.Automation)

(none)

0x802b001f

ElementNotEnabledException (Windows.UI.Xaml.Automation)

(none)

0x802b001e

LayoutCycleException (Windows.UI.Xaml)

(none)

0x802b0014

XamlParseException (Windows.UI.Xaml.Markup)

(none)

0x802b000a

Explanation

In the ".NET Exception" on the column of the table, you link the name of an exception, the exception is part of the application class .NET for Windows is running. This means that you can trigger a new anomaly of this type in your own code. Or you can catch some of these abnormalities, especially as a try-catch or UnhandledException exception handling. If you do not link the name of an exception, the exception is not part of the runtime class of .NET for Windows. Does not belong to set .NET for Windows runtime exception may experience some interoperability solution, may also come from within the system or Windows is running. You will not be able to use the specific exception type catch block to write for them because when you run the Windows applications running .NET library does not know the type. But you can still read a HRESULT code from "HRESULT (s) -raw:" column, look for it, and noticed that there is a corresponding .NET exceptions. Or you can use it as a general exception. You can then read the .NET documentation, may be able to find out more information about the cause of the exception and the original intent of the code that throws the exception, even if the exception is not running in .NET for Windows when the type of representation. If you do not .NET exceptions listed namespace, it comes from the system namespace.

"HRESULT (s) -symbolic" Constants listed in the column from a variety of sources. Some are defined in the winerror.h in, some are defined in a specific Component Object Model (COM) programming header file, some belonging to the first file in the Windows-specific subsystems defined. Some require the use of macros HRESULT_From_Win32, wherein the code comprises a set of constants from an earlier (front ERROR_). For a typical Windows programming language when using the .NET runtime, these header files are not provided as part of the project. If you are getting the system can not be mapped to a standard error code information under abnormal circumstances, it may treats it as original integer or hexadecimal values, and does not automatically support the numeric code for Windows alias name of a constant value. Nevertheless, on the basis of previous Windows error reporting system, based on their history remains constant name instead of the original code refers to the error code. You can further explore other document sources (such as forums or supporting documents) errors in the use of named constants in the table, in particular, what the error means desktop programming, Microsoft Win32 and COM and so on.

SystemException : In the original exception hierarchy .NET, many anomalies are derived from the system anomalies. For example, derived from SystemException System.ArgumentException. SystemException inherited from the core definition indicate .NET exception. Windows .NET class collection of run-time system is not included abnormalities. All in complete framework derived from SystemException exceptions are derived from System.Exception.
COMException: NET documentation advice to any unrecognized HRESULT throw COMException, but this is not the behavior of the application while Windows is running. Instead, COMException usually a standard component from unmapped abnormal abnormality. No mapping system or application code from your own exception report for the basic disorder in which the value is not HResult standards.
ExternalException: not included in .NET for Windows is running. For exceptions (such as SEHException) does exist, the hierarchy can not see it.

 

 

Guess you like

Origin www.cnblogs.com/yilang/p/12000711.html