.

This is a list of .net exceptions which I compiled. It is by no mean complete. I created this list to help me with the question, "which exception should I throw now that condition X has occurred?" The highlighted rows are the ones which I have used or plan to use.

.

ExceptionUsage

.

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

.

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

.

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

.

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

.

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

.

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

.

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

.

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

.

System.ComponentModel.Design.Serialization.CodeDomSerializerExceptionThe exception that is thrown when line number information is available for a serialization error.

.

System.ComponentModel.LicenseExceptionRepresents the exception thrown when a component cannot be granted a license.

.

System.ComponentModel.WarningExceptionSpecifies an exception that is handled as a warning instead of an error.

.

System.Configuration.ConfigurationExceptionThe exception that is thrown when a configuration system error has occurred.

.

System.Configuration.Install.InstallExceptionThe exception that is thrown when an error occurs during the commit, rollback, or uninstall phase of an installation.

.

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

.

System.Data.DataExceptionRepresents the exception that is thrown when errors are generated using ADO.NET components.

.

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

.

System.Data.OperationAbortedExceptionThis exception is thrown when an ongoing operation is aborted by the user.

.

System.Data.SqlTypes.SqlTypeExceptionThe base exception class for the System.Data.SqlTypes.

.

System.DataMisalignedExceptionThe 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.

.

System.Deployment.Application.DeploymentExceptionDefines a base class for all deployment-related exceptions.

.

System.Drawing.Printing.InvalidPrinterExceptionRepresents the exception that is thrown when you try to access a printer using printer settings that are not valid.

.

System.EnterpriseServices.RegistrationExceptionThe exception that is thrown when a registration error is detected.

.

System.EnterpriseServices.ServicedComponentExceptionThe exception that is thrown when an error is detected in a serviced component.

.

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

.

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

.

System.IndexOutOfRangeExceptionThe 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.

.

System.InvalidCastExceptionThe exception that is thrown for invalid casting or explicit conversion.

.

System.InvalidOperationExceptionThe exception that is thrown when a method call is invalid for the object's current state.

.

System.InvalidProgramExceptionThe 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.

.

System.IO.DirectoryNotFoundExceptionThe exception that is thrown when part of a file or directory cannot be found.

.

System.IO.DriveNotFoundExceptionThe exception that is thrown when trying to access a drive or share that is not available.

.

System.IO.EndOfStreamExceptionThe exception that is thrown when reading is attempted past the end of a stream.

.

System.IO.FileLoadExceptionThe exception that is thrown when a managed assembly is found but cannot be loaded.

.

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

.

System.IO.InternalBufferOverflowExceptionThe exception thrown when the internal buffer overflows.

.

System.IO.InvalidDataExceptionThe exception that is thrown when a data stream is in an invalid format.

.

System.IO.IOExceptionThe exception that is thrown when an I/O error occurs.

.

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

.

System.Management.ManagementExceptionRepresents management exceptions.

.

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

.

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

.

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

.

System.NotSupportedExceptionThe 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.

.

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

.

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

.

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

.

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

.

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

.

System.Reflection.ReflectionTypeLoadExceptionThe exception that is thrown by the Module.GetTypes method if any of the classes in a module cannot be loaded. This class cannot be inherited.

.

System.Resources.MissingManifestResourceExceptionThe 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.

.

System.Resources.MissingSatelliteAssemblyExceptionThe exception that is thrown when the satellite assembly for the resources of the neutral culture is missing.

.

System.Runtime.InteropServices.ExternalExceptionThe base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions.

.

System.Runtime.InteropServices.InvalidComObjectExceptionThe exception thrown when an invalid COM object is used.

.

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

.

System.Runtime.InteropServices.MarshalDirectiveExceptionThe exception that is thrown by the marshaler when it encounters a MarshalAsAttribute it does not support.

.

System.Runtime.InteropServices.SafeArrayRankMismatchExceptionThe exception thrown when the rank of an incoming SAFEARRAY does not match the rank specified in the managed signature.

.

System.Runtime.InteropServices.SafeArrayTypeMismatchExceptionThe exception thrown when the type of the incoming SAFEARRAY does not match the type specified in the managed signature.

.

System.Runtime.Remoting.RemotingExceptionThe exception that is thrown when something has gone wrong during remoting.

.

System.Runtime.Remoting.ServerExceptionThe 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.SerializationExceptionThe exception thrown when an error occurs during serialization or deserialization.

.

System.Security.Authentication.AuthenticationExceptionThe exception that is thrown when authentication fails for an authentication stream.

.

System.Security.Cryptography.CryptographicExceptionThe exception that is thrown when an error occurs during a cryptographic operation.

.

System.Security.HostProtectionExceptionThe exception that is thrown when a denied host resource is detected.

.

System.Security.Policy.PolicyExceptionThe exception that is thrown when policy forbids code to run.

.

System.Security.Principal.IdentityNotMappedExceptionRepresents an exception for a principal whose identity could not be mapped to a known identity.

.

System.Security.SecurityExceptionThe exception that is thrown when a security error is detected.

.

System.Security.VerificationExceptionThe 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.

.

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

.

System.ServiceProcess.TimeoutExceptionThe exception that is thrown when a specified timeout has expired.

.

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

.

System.Threading.AbandonedMutexExceptionThe exception that is thrown when one thread acquires a Mutex object that another thread has abandoned by exiting without releasing it.

.

System.Threading.SemaphoreFullExceptionThe exception that is thrown when the System.Threading.Semaphore.Release method is called on a semaphore whose count is already at the maximum.

.

System.Threading.SynchronizationLockExceptionThe 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.

.

System.Threading.ThreadAbortExceptionThe exception that is thrown when a call is made to the Abort method. This class cannot be inherited.

.

System.Threading.ThreadInterruptedExceptionThe exception that is thrown when a Thread is interrupted while it is in a waiting state.

.

System.Threading.ThreadStartExceptionThe 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.

.

System.Threading.ThreadStateExceptionThe exception that is thrown when a Thread is in an invalid ThreadState for the method call.

.

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

.

System.Transactions.TransactionExceptionThe exception that is thrown when you attempt to do work on a transaction that cannot accept new work.

.

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

.

System.TypeLoadExceptionThe exception that is thrown when type-loading failures occur.

.

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

.

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

.

System.Web.Caching.DatabaseNotEnabledForNotificationExceptionThe exception that is thrown when a SQL Server database is not enabled to support dependencies associated with the SqlCacheDependency class. This class cannot be inherited.

.

System.Web.Caching.TableNotEnabledForNotificationExceptionThe exception that is thrown when a SqlCacheDependency class is used against a database table that is not enabled for change notifications.

.

System.Web.Management.SqlExecutionExceptionDefines a class for SQL execution exceptions in the System.Web.Management namespace.

.

System.Web.Services.Protocols.SoapExceptionRepresents the exception that is thrown when an XML Web service method is called over SOAP and an exception occurs.

.

System.Xml.Schema.XmlSchemaExceptionReturns detailed information about the schema exception.

.

System.Xml.XmlExceptionReturns detailed information about the last exception.

.

System.Xml.XPath.XPathExceptionProvides the exception thrown when an error occurs while processing an XPath expression.

.

System.Xml.Xsl.XsltExceptionThe exception that is thrown when an error occurs while processing an XSLT transformation.