Skip to main content

Exceptions

System Exception

ExceptionCondition
AccessViolationExceptionIt is thrown when try to read or write protected memory.
AggregateExceptionRepresents one or more errors that occur during application execution.
AppDomainUnloadedExceptionIt is thrown when try to access an unloaded application domain.
ApplicationExceptionIt is base class for application-defined exceptions.
ArgumentExceptionIt is thrown when invalid argument provided to a method.
ArgumentNullExceptionIt is thrown when a method requires argument but no argument is provided.
ArgumentOutOfRangeExceptionIt is thrown when value of an argument is outside the allowable range.
ArithmeticExceptionIt is thrown when doing arithmetic, casting, or conversion operation.
ArrayTypeMismatchExceptionIt is thrown when try to store an element of the wrong type within an array.
BadImageFormatExceptionIt is thrown when file image, dll or exe program is invalid.
CannotUnloadAppDomainExceptionIt is thrown when try to unload an application domain fails.
ContextMarshalExceptionThe exception that is thrown when an attempt to marshal an object across a context boundary fails.
DataMisalignedExceptionIt is thrown thrown when a unit of data is read from or written to an address that is not a multiple of the data size.
DivideByZeroExceptionIt is thrown when there is an attempt to divide an integral or decimal value by zero.
DllNotFoundExceptionIt is thrown when a DLL specified in a DLL import cannot be found.
DuplicateWaitObjectExceptionThe exception that is thrown when an object appears more than once in an array of synchronization objects.
EntryPointNotFoundExceptionThe exception that is thrown when an attempt to load a class fails due to the absence of an entry method.
ExecutionEngineExceptionThe exception that is thrown when there is an internal error in the execution engine of the common language runtime.
FieldAccessExceptionIt is thrown when there is an invalid attempt to access a private or protected field inside a class.
FormatExceptionThe exception that is thrown when the format of an argument is invalid, or when a composite format string is not well formed.
IndexOutOfRangeExceptionThe exception that is thrown when an attempt is made to access an element of an array or collection with an index that is outside its bounds.
InsufficientMemoryExceptionThe exception that is thrown when a check for sufficient available memory fails. This class cannot be inherited.
InvalidCastExceptionThe exception that is thrown for invalid casting or explicit conversion.
InvalidOperationExceptionThe exception that is thrown when a method call is invalid for the object's current state.
InvalidProgramExceptionThe exception that is thrown when a program contains invalid Microsoft intermediate language (MSIL) or metadata.
InvalidTimeZoneExceptionThe exception that is thrown when time zone information is invalid.
MemberAccessExceptionThe exception that is thrown when an attempt to access a class member fails.
MethodAccessExceptionThe exception that is thrown when there is an invalid attempt to access a method, such as accessing a private method from partially trusted code.
MissingFieldExceptionThe exception that is thrown when there is an attempt to dynamically access a field that does not exist.
MissingMemberExceptionThe exception that is thrown when there is an attempt to dynamically access a class member that does not exist.
MissingMethodExceptionThe exception that is thrown when there is an attempt to dynamically access a method that does not exist.
MulticastNotSupportedExceptionThe exception that is thrown when there is an attempt to combine two delegates based on the Delegate type instead of the MulticastDelegate type.
NotCancelableExceptionIt is thrown when an attempt is made to cancel an operation that is not cancelable.
NotFiniteNumberExceptionThe exception that is thrown when a floating-point value is positive infinity, negative infinity, or Not-a-Number (NaN).
NotImplementedExceptionThe exception that is thrown when a requested method or operation is not implemented.
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.
NullReferenceExceptionThe exception that is thrown when there is an attempt to dereference a null object reference.
ObjectDisposedExceptionThe exception that is thrown when an operation is performed on a disposed object.
OperationCanceledExceptionThe exception that is thrown in a thread upon cancellation of an operation that the thread was executing.
OutOfMemoryExceptionThe exception that is thrown when there is not enough memory to continue the execution of a program.
OverflowExceptionThe exception that is thrown when an arithmetic, casting, or conversion operation in a checked context results in an overflow.
PlatformNotSupportedExceptionThe exception that is thrown when a feature does not run on a particular platform.
RankExceptionThe exception that is thrown when an array with the wrong number of dimensions is passed to a method.
StackOverflowExceptionThe exception that is thrown when the execution stack overflows because it contains too many nested method calls.
SystemExceptionServes as the base class for system exceptions namespace.
TimeoutExceptionThe exception that is thrown when the time allotted for a process or operation has expired.
TimeZoneNotFoundExceptionThe exception that is thrown when a time zone cannot be found.
TypeAccessExceptionThe exception that is thrown when a method attempts to use a type that it does not have access to.
TypeInitializationExceptionThe exception that is thrown as a wrapper around the exception thrown by the class initializer. This class cannot be inherited.
TypeLoadExceptionThe exception that is thrown when type-loading failures occur.
TypeUnloadedExceptionThe exception that is thrown when there is an attempt to access an unloaded class.
UnauthorizedAccessExceptionThe exception that is thrown when the operating system denies access because of an I/O error or a specific type of security error.
UriFormatExceptionThe exception that is thrown when an invalid Uniform Resource Identifier (URI) is detected.

System.Data Exception

ExceptionCondition
ConstraintExceptionRepresents the exception that is thrown when attempting an action that violates a constraint.
DataExceptionRepresents the exception that is thrown when attempting an action that violates a constraint.
DBConcurrencyExceptionGets or sets the value of the DataRow that generated the DBConcurrencyException.
DeleteRowInaccessibleExceptionRepresents the exception that is thrown when an action is tried on a DataRow that has been deleted.
DuplicateNameExceptionRepresents the exception that is thrown when a duplicate database object name is encountered during an add operation in a DataSet -related object.
EvaluateExceptionRepresents the exception that is thrown when the Expression property of a DataColumn cannot be evaluated.
InRowChangingEventExceptionRepresents the exception that is thrown when you call the EndEdit method within the RowChanging event.
InvalidConstraintExceptionRepresents the exception that is thrown when incorrectly trying to create or access a relation.
InvalidExpressionExceptionRepresents the exception that is thrown when you try to add a DataColumn that contains an invalid Expression to a DataColumnCollection.
MissingPrimaryKeyExceptionRepresents the exception that is thrown when you try to access a row in a table that has no primary key.
NoNullAllowedExceptionRepresents the exception that is thrown when you try to insert a null value into a column where AllowDBNull is set tofalse.
OperationAbortedExceptionThis exception is thrown when an ongoing operation is aborted by the user.
ReadOnlyExceptionRepresents the exception that is thrown when you try to change the value of a read-only column.
RowNotInTableExceptionRepresents the exception that is thrown when you try to perform an operation on a DataRow that is not in a DataTable.
StrongTypingExceptionThe exception that is thrown by a strongly typed DataSet when the user accesses a DBNull value.
SyntaxErrorExceptionRepresents the exception that is thrown when the Expression property of a DataColumn contains a syntax error.
TypedDataSetGeneratorExceptionThe exception that is thrown when a name conflict occurs while generating a strongly typed DataSet.
VersionNotFoundExceptionRepresents the exception that is thrown when you try to return a version of a DataRow that has been deleted.

System.IO Exception

ExceptionCondition
DirectoryNotFoundExceptionThe exception that is thrown when part of a file or directory cannot be found.
DriveNotFoundExceptionThe exception that is thrown when a drive that is referenced by an operation could not be found.
EndOfStreamExceptionAn EndOfStreamException exception is thrown when there is an attempt to read past the end of a stream.
FileFormatExceptionThe exception that is thrown when an input file or a data stream that is supposed to conform to a certain file format specification is malformed.
FileLoadExceptionThe exception that is thrown when a managed assembly is found but cannot be loaded.
FileNotFoundExceptionThe exception that is thrown when an attempt to access a file that does not exist on disk fails.
InternalBufferOverflowExceptionThe exception thrown when the internal buffer overflows.
InvalidDataExceptionThe exception that is thrown when a data stream is in an invalid format.
IOExceptionThe exception that is thrown when an I/O error occurs.
PathTooLongExceptionThe exception that is thrown when a path or file name is longer than the system-defined maximum length.
PipeExceptionThrown when an error occurs within a named pipe.

Exceptions and Exception Handling - C# | Microsoft Learn
C# Exceptions - GeeksforGeeks