Compiler-Generated Exceptions (C# Programming Guide)
Some exceptions are thrown automatically by the .NET Framework's common language runtime (CLR) as a result of basic operations that fail. These exceptions and their error conditions are listed below.
Exception | Description |
---|---|
A base class for exceptions that occur during arithmetic operations, such as DivideByZeroException and OverflowException . |
|
Thrown when an array cannot store a given element because the actual type of the element is incompatible with the actual type of the array. |
|
DivideByZeroException |
Thrown when an attempt is made to divide an integral value by zero. |
Thrown when an attempt is made to index an array when the index is less than zero or outside the bounds of the array. |
|
Thrown when an explicit conversion from a base type to an interface or to a derived type fails at runtime. |
|
Thrown when a |
|
Thrown when an attempt to allocate memory via |
|
OverflowException |
Thrown when an arithmetic operation in a |
Thrown when the execution stack is exhausted by having too many pending method calls; usually indicates a very deep or infinite recursion. |
|
Thrown when a static constructor throws an exception and no compatible |
See Also
Reference
Exceptions and Exception Handling (C# Programming Guide)
Exception Handling (C# Programming Guide)
try-catch (C# Reference)
try-finally (C# Reference)
try-catch-finally (C# Reference)