.NET Exceptions (all of them)

July 8, 2009 § 19 Comments

I wanted a list of .NET exceptions. I went looking and couldn’t really find what I was looking for. This post on codinghorror.com helped me get started (especially the work Paul Cotter did), but didn’t really answer the whole question for me. I hacked up the source code that was posted on the site, referenced the XML file generated from the XML comments in the .NET assemblies, linked the exceptions to the MSDN documentation, and generated the following list.

Some of these links are broken (they don’t seem to be documented exceptions). I will probably update this post at some point to remove the links for the exceptions that aren’t documented. I will also post the source code I used to generate the list once all the embarrassing hacks are cleaned up. Check back in a day or two. You can find the source code here.

This list is based on the 3.5 framework.

mscorlib.dll

System
AccessViolationException

The exception that is thrown when there is an attempt to read or write protected memory.

AppDomainUnloadedException

The exception that is thrown when an attempt is made to access an unloaded application domain.

ApplicationException

The exception that is thrown when a non-fatal application error occurs.

ArgumentException

The exception that is thrown when one of the arguments provided to a method is not valid.

ArgumentNullException

The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

ArgumentOutOfRangeException

The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method.

ArithmeticException

The exception that is thrown for errors in an arithmetic, casting, or conversion operation.

ArrayTypeMismatchException

The exception that is thrown when an attempt is made to store an element of the wrong type within an array.

ASSERT
BadImageFormatException

The exception that is thrown when the file image of a DLL or an executable program is invalid.

CannotUnloadAppDomainException

The exception that is thrown when an attempt to unload an application domain fails.

ContextMarshalException

The exception that is thrown when an attempt to marshal an object across a context boundary fails.

DataMisalignedException

The exception that is thrown when a unit of data is read from or written to an address that is not a multiple of the data size. This class cannot be inherited.

DivideByZeroException

The exception that is thrown when there is an attempt to divide an integral or decimal value by zero.

DllNotFoundException

The exception that is thrown when a DLL specified in a DLL import cannot be found.

DuplicateWaitObjectException

The exception that is thrown when an object appears more than once in an array of synchronization objects.

EntryPointNotFoundException

The exception that is thrown when an attempt to load a class fails due to the absence of an entry method.

ExecutionEngineException

The exception that is thrown when there is an internal error in the execution engine of the common language runtime. This class cannot be inherited.

FieldAccessException

The exception that is thrown when there is an invalid attempt to access a private or protected field inside a class.

FormatException

The exception that is thrown when the format of an argument does not meet the parameter specifications of the invoked method.

IndexOutOfRangeException

The exception that is thrown when an attempt is made to access an element of an array with an index that is outside the bounds of the array. This class cannot be inherited.

InsufficientMemoryException

The exception that is thrown when a check for sufficient available memory fails. This class cannot be inherited.

InvalidCastException

The exception that is thrown for invalid casting or explicit conversion.

InvalidOperationException

The exception that is thrown when a method call is invalid for the object’s current state.

InvalidProgramException

The exception that is thrown when a program contains invalid Microsoft intermediate language (MSIL) or metadata. Generally this indicates a bug in the compiler that generated the program.

MemberAccessException

The exception that is thrown when an attempt to access a class member fails.

MethodAccessException

The exception that is thrown when there is an invalid attempt to access a private or protected method inside a class.

MissingFieldException

The exception that is thrown when there is an attempt to dynamically access a field that does not exist.

MissingMemberException

The exception that is thrown when there is an attempt to dynamically access a class member that does not exist.

MissingMethodException

The exception that is thrown when there is an attempt to dynamically access a method that does not exist.

MulticastNotSupportedException

The exception that is thrown when there is an attempt to combine two delegates based on the type instead of the type. This class cannot be inherited.

NotFiniteNumberException

The exception that is thrown when a floating-point value is positive infinity, negative infinity, or Not-a-Number (NaN).

NotImplementedException

The exception that is thrown when a requested method or operation is not implemented.

NotSupportedException

The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality.

NullReferenceException

The exception that is thrown when there is an attempt to dereference a null object reference.

ObjectDisposedException

The exception that is thrown when an operation is performed on a disposed object.

OperationCanceledException

The exception that is thrown in a thread upon cancellation of an operation that the thread was executing.

OutOfMemoryException

The exception that is thrown when there is not enough memory to continue the execution of a program.

OverflowException

The exception that is thrown when an arithmetic, casting, or conversion operation in a checked context results in an overflow.

PlatformNotSupportedException

The exception that is thrown when a feature does not run on a particular platform.

RankException

The exception that is thrown when an array with the wrong number of dimensions is passed to a method.

StackOverflowException

The exception that is thrown when the execution stack overflows because it contains too many nested method calls. This class cannot be inherited.

SystemException

Defines the base class for predefined exceptions in the namespace.

TimeoutException

The exception that is thrown when the time allotted for a process or operation has expired.

TypeInitializationException

The exception that is thrown as a wrapper around the exception thrown by the class initializer. This class cannot be inherited.

TypeLoadException

The exception that is thrown when type-loading failures occur.

TypeUnloadedException

The exception that is thrown when there is an attempt to access an unloaded class.

UnauthorizedAccessException

The exception that is thrown when the operating system denies access because of an I/O error or a specific type of security error.

System.Collections.Generic

KeyNotFoundException

The exception that is thrown when the key specified for accessing an element in a collection does not match any key in the collection.

System.IO

DirectoryNotFoundException

The exception that is thrown when part of a file or directory cannot be found.

DriveNotFoundException

The exception that is thrown when trying to access a drive or share that is not available.

EndOfStreamException

The exception that is thrown when reading is attempted past the end of a stream.

FileLoadException

The exception that is thrown when a managed assembly is found but cannot be loaded.

FileNotFoundException

The exception that is thrown when an attempt to access a file that does not exist on disk fails.

IOException

The exception that is thrown when an I/O error occurs.

PathTooLongException

The exception that is thrown when a pathname or filename is longer than the system-defined maximum length.

System.IO.IsolatedStorage

IsolatedStorageException

The exception that is thrown when an operation in isolated storage fails.

System.Reflection

AmbiguousMatchException

The exception that is thrown when binding to a member results in more than one member matching the binding criteria. This class cannot be inherited.

CustomAttributeFormatException

The exception that is thrown when the binary format of a custom attribute is invalid.

InvalidFilterCriteriaException

The exception that is thrown in when the filter criteria is not valid for the type of filter you are using.

MetadataException
ReflectionTypeLoadException

The exception that is thrown by the method if any of the classes in a module cannot be loaded. This class cannot be inherited.

TargetException

Represents the exception that is thrown when an attempt is made to invoke an invalid target.

TargetInvocationException

The exception that is thrown by methods invoked through reflection. This class cannot be inherited.

TargetParameterCountException

The exception that is thrown when the number of parameters for an invocation does not match the number expected. This class cannot be inherited.

System.Resources

MissingManifestResourceException

The exception thrown if the main assembly does not contain the resources for the neutral culture, and they are required because of a missing appropriate satellite assembly.

MissingSatelliteAssemblyException

The exception that is thrown when the satellite assembly for the resources of the neutral culture is missing.

System.Runtime.CompilerServices

RuntimeWrappedException

Wraps an exception that does not derive from the class. This class cannot be inherited.

System.Runtime.InteropServices

COMException

The exception that is thrown when an unrecognized HRESULT is returned from a COM method call.

ExternalException

The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions.

InvalidComObjectException

The exception thrown when an invalid COM object is used.

InvalidOleVariantTypeException

The exception thrown by the marshaler when it encounters an argument of a variant type that can not be marshaled to managed code.

MarshalDirectiveException

The exception that is thrown by the marshaler when it encounters a it does not support.

SafeArrayRankMismatchException

The exception thrown when the rank of an incoming SAFEARRAY does not match the rank specified in the managed signature.

SafeArrayTypeMismatchException

The exception thrown when the type of the incoming SAFEARRAY does not match the type specified in the managed signature.

SEHException

Represents Structured Exception Handler (SEH) errors.

System.Runtime.Remoting

RemotingException

The exception that is thrown when something has gone wrong during remoting.

RemotingTimeoutException

The exception that is thrown when the server or the client cannot be reached for a previously specified period of time.

ServerException

The exception that is thrown to communicate errors to the client when the client connects to non-.NET Framework applications that cannot throw exceptions.

System.Runtime.Serialization

SerializationException

The exception thrown when an error occurs during serialization or deserialization.

System.Security

HostProtectionException

The exception that is thrown when a denied host resource is detected.

SecurityException

The exception that is thrown when a security error is detected.

VerificationException

The exception that is thrown when the security policy requires code to be type safe and the verification process is unable to verify that the code is type safe.

XmlSyntaxException

The exception that is thrown when there is a syntax error in XML parsing. This class cannot be inherited.

System.Security.AccessControl

PrivilegeNotHeldException

The exception that is thrown when a method in the namespace attempts to enable a privilege that it does not have.

System.Security.Cryptography

CryptographicException

The exception that is thrown when an error occurs during a cryptographic operation.

CryptographicUnexpectedOperationException

The exception that is thrown when an unexpected operation occurs during a cryptographic operation.

System.Security.Policy

PolicyException

The exception that is thrown when policy forbids code to run.

System.Security.Principal

IdentityNotMappedException

Represents an exception for a principal whose identity could not be mapped to a known identity.

System.Text

DecoderFallbackException

The exception that is thrown when a decoder fallback operation fails. This class cannot be inherited.

EncoderFallbackException

The exception that is thrown when an encoder fallback operation fails. This class cannot be inherited.

System.Threading

AbandonedMutexException

The exception that is thrown when one thread acquires a object that another thread has abandoned by exiting without releasing it.

SynchronizationLockException

The exception that is thrown when a method requires the caller to own the lock on a given Monitor, and the method is invoked by a caller that does not own that lock.

ThreadAbortException

The exception that is thrown when a call is made to the method. This class cannot be inherited.

ThreadInterruptedException

The exception that is thrown when a is interrupted while it is in a waiting state.

ThreadStartException

The exception that is thrown when a failure occurs in a managed thread after the underlying operating system thread has been started, but before the thread is ready to execute user code.

ThreadStateException

The exception that is thrown when a is in an invalid for the method call.

WaitHandleCannotBeOpenedException

The exception that is thrown when an attempt is made to open a system mutex or semaphore that does not exist.

System.AddIn.dll

Microsoft.Contracts
Contract+AssertionException
Contract+AssumptionException
Contract+InvariantException
Contract+PostconditionException
Contract+PreconditionException

System.AddIn.Hosting

AddInBaseInAddInFolderException
AddInSegmentDirectoryNotFoundException
InvalidPipelineStoreException

System.AddIn.MiniReflection

GenericsNotImplementedException

System.Configuration.dll

System.Configuration
ConfigurationErrorsException

The current value is not one of the values.

System.Configuration.Provider

ProviderException

The exception that is thrown when a configuration provider error has occurred. This exception class is also used by providers to throw exceptions when internal errors occur within the provider that do not map to other pre-existing exception classes.

System.Configuration.Install.dll

System.Configuration.Install
InstallException

The exception that is thrown when an error occurs during the commit, rollback, or uninstall phase of an installation.

System.Data.dll

<CrtImplementationDetails>
ModuleLoadException
ModuleLoadExceptionHandlerException

Microsoft.SqlServer.Server

InvalidUdtException

Thrown when SQL Server or the ADO.NET provider detects an invalid user-defined type (UDT).

System.Data

ConstraintException

Represents the exception that is thrown when attempting an action that violates a constraint.

DataException

Represents the exception that is thrown when errors are generated using ADO.NET components.

DBConcurrencyException

The exception that is thrown by the during an insert, update, or delete operation if the number of rows affected equals zero.

DeletedRowInaccessibleException

Represents the exception that is thrown when an action is tried on a that has been deleted.

DuplicateNameException

Represents the exception that is thrown when a duplicate database object name is encountered during an add operation in a -related object.

EvaluateException

Represents the exception that is thrown when the property of a cannot be evaluated.

InRowChangingEventException

Represents the exception that is thrown when you call the method within the event.

InvalidConstraintException

Represents the exception that is thrown when incorrectly trying to create or access a relation.

InvalidExpressionException

Represents the exception that is thrown when you try to add a that contains an invalid to a .

MissingPrimaryKeyException

Represents the exception that is thrown when you try to access a row in a table that has no primary key.

NoNullAllowedException

Represents the exception that is thrown when you try to insert a null value into a column where is set to false.

OperationAbortedException

This exception is thrown when an ongoing operation is aborted by the user.

ReadOnlyException

Represents the exception that is thrown when you try to change the value of a read-only column.

RowNotInTableException

Represents the exception that is thrown when you try to perform an operation on a that is not in a .

StrongTypingException

The exception that is thrown by a strongly typed when the user accesses a DBNull value.

SyntaxErrorException

Represents the exception that is thrown when the property of a contains a syntax error.

TypedDataSetGeneratorException

The exception that is thrown when a name conflict occurs while generating a strongly typed .

VersionNotFoundException

Represents the exception that is thrown when you try to return a version of a that has been deleted.

System.Data.Common

DbException

The base class for all exceptions thrown on behalf of the data source.

System.Data.Odbc

OdbcException

The exception that is generated when a warning or error is returned by an ODBC data source. This class cannot be inherited.

System.Data.OleDb

OleDbException

The exception that is thrown when the underlying provider returns a warning or error for an OLE DB data source. This class cannot be inherited.

System.Data.SqlClient

SqlException

The exception that is thrown when SQL Server returns a warning or error. This class cannot be inherited.

System.Data.SqlTypes

SqlAlreadyFilledException

The class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.

SqlNotFilledException

The class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.

SqlNullValueException

The exception that is thrown when the Value property of a structure is set to null.

SqlTruncateException

The exception that is thrown when you set a value into a structure would truncate that value.

SqlTypeException

The base exception class for the .

System.Drawing.dll

System.Drawing.Printing
InvalidPrinterException

Represents the exception that is thrown when you try to access a printer using printer settings that are not valid.

System.DirectoryServices.dll

System.DirectoryServices
DirectoryServicesCOMException

Contains extended error information about an error that occurred when the method is called.

System.DirectoryServices.ActiveDirectory

ActiveDirectoryObjectExistsException

The class exception is thrown when an Active Directory Domain Services object is created and that object already exists in the underlying directory store.

ActiveDirectoryObjectNotFoundException

The class exception is thrown when a requested object is not found in the underlying directory store.

ActiveDirectoryOperationException

The class exception is thrown when an underlying directory operation fails.

ActiveDirectoryServerDownException

The class exception is thrown when a server is unavailable to respond to a service request.

ForestTrustCollisionException

The class exception is thrown when a trust collision occurs during a trust relationship management request.

SyncFromAllServersOperationException

The exception is thrown when the request to synchronize from all servers fails.

System.Management.dll

System.Management
ManagementException

Represents management exceptions.

System.Messaging.dll

System.Messaging
MessageQueueException

The exception that is thrown if a Microsoft Message Queuing internal error occurs.

System.ServiceProcess.dll

System.ServiceProcess
TimeoutException

The exception that is thrown when a specified timeout has expired.

System.Web.dll

System.Web
HttpCompileException

The exception that is thrown when a compiler error occurs.

HttpException

Describes an exception that occurred during the processing of HTTP requests.

HttpParseException

The exception that is thrown when a parse error occurs.

HttpRequestValidationException

The exception that is thrown when a potentially malicious input string is received from the client as part of the request data. This class cannot be inherited.

HttpUnhandledException

The exception that is thrown when a generic exception occurs.

System.Web.Caching

DatabaseNotEnabledForNotificationException

The exception that is thrown when a SQL Server database is not enabled to support dependencies associated with the class. This class cannot be inherited.

TableNotEnabledForNotificationException

The exception that is thrown when a class is used against a database table that is not enabled for change notifications.

System.Web.Hosting

HostingEnvironmentException

System.Web.Management

SqlExecutionException

Defines a class for SQL execution exceptions in the namespace.

System.Web.Security

MembershipCreateUserException

The exception that is thrown when a user is not successfully created by a membership provider.

MembershipPasswordException

The exception that is thrown when a password cannot be retrieved from the password store.

System.Web.UI

ViewStateException

Represents the exception that is thrown when the view state cannot be loaded or validated. This class cannot be inherited.

System.Windows.Forms.dll

System.Windows.Forms
AxHost+InvalidActiveXStateException

System.Design.dll

System.ComponentModel.Design
ExceptionCollection

Represents the collection of exceptions.

System.ComponentModel.Design.Serialization

CodeDomSerializerException

The exception that is thrown when line number information is available for a serialization error.

System.Data.Design

DataSourceGeneratorException
DataSourceSerializationException
InternalException
NameValidationException
TypedDataSetGeneratorException

The exception that is thrown when a name conflict occurs while a strongly typed is being generated.

System.Xml.dll

System.Xml
XmlException

Returns detailed information about the last exception.

System.Xml.Schema

UpaException
XmlSchemaException

Returns detailed information about the schema exception.

XmlSchemaInferenceException

Returns information about errors encountered by the class while inferring a schema from an XML document.

XmlSchemaValidationException

Represents the exception thrown when XML Schema Definition Language (XSD) schema validation errors and warnings are encountered in an XML document being validated.

System.Xml.XPath

XPathException

Provides the exception thrown when an error occurs while processing an XPath expression.

System.Xml.Xsl

XsltCompileException

The exception that is thrown by the Load method when an error is found in the XSLT style sheet.

XsltException

The exception that is thrown when an error occurs while processing an XSLT transformation.

System.dll

System
UriFormatException

The exception that is thrown when an invalid Uniform Resource Identifier (URI) is detected.

System.ComponentModel

InvalidAsynchronousStateException

Thrown when a thread on which an operation should execute no longer exists or has no message loop.

InvalidEnumArgumentException

The exception thrown when using invalid arguments that are enumerators.

LicenseException

Represents the exception thrown when a component cannot be granted a license.

WarningException

Specifies an exception that is handled as a warning instead of an error.

Win32Exception

Throws an exception for a Win32 error code.

System.ComponentModel.Design

CheckoutException

The exception that is thrown when an attempt to check out a file that is checked into a source code management program is canceled or fails.

System.Configuration

ConfigurationException

The exception that is thrown when a configuration system error has occurred.

SettingsPropertyIsReadOnlyException

Provides an exception for read-only objects.

SettingsPropertyNotFoundException

Provides an exception for objects that are not found.

SettingsPropertyWrongTypeException

Provides an exception that is thrown when an invalid type is used with a object.

System.IO

InternalBufferOverflowException

The exception thrown when the internal buffer overflows.

InvalidDataException

The exception that is thrown when a data stream is in an invalid format.

System.Net

CookieException

The exception that is thrown when an error is made adding a to a .

HttpListenerException

The exception that is thrown when an error occurs processing an HTTP request.

InternalException
ProtocolViolationException

The exception that is thrown when an error is made while using a network protocol.

WebException

The exception that is thrown when an error occurs while accessing the network through a pluggable protocol.

System.Net.Mail

SmtpException

Represents the exception that is thrown when the is not able to complete a or operation.

SmtpFailedRecipientException

Represents the exception that is thrown when the is not able to complete a or operation to a particular recipient.

SmtpFailedRecipientsException

The exception that is thrown when e-mail is sent using an and cannot be delivered to all recipients.

System.Net.NetworkInformation

NetworkInformationException

The exception that is thrown when an error occurs while retrieving network information.

PingException

The exception that is thrown when a or method calls a method that throws an exception.

System.Net.Sockets

SocketException

The exception that is thrown when a socket error occurs.

System.Security.Authentication

AuthenticationException

The exception that is thrown when authentication fails for an authentication stream.

InvalidCredentialException

The exception that is thrown when authentication fails for an authentication stream and cannot be retried.

System.Threading

SemaphoreFullException

The exception that is thrown when the method is called on a semaphore whose count is already at the maximum.

About these ads

Tagged: , , , ,

§ 19 Responses to .NET Exceptions (all of them)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading .NET Exceptions (all of them) at Mike Vallotton's Blog.

meta

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: