Mono Class Library: System NamespaceSystem.StackOverflowException Class |
See Also: StackOverflowException Members
System.Object
System.Exception
System.SystemException
System.StackOverflowException
|
All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.
Note:[Edit]StackOverflowException is thrown for execution stack overflow errors, typically in the case of a very deep or unbounded recursion.
The localloc CIL instruction throws StackOverflowException.
The following example demonstrates an error that causes a StackOverflowException exception.
C# Example using System; public class StackOverflowExample { public static void recursion() { recursion(); } public static void Main() { try { recursion(); } catch(StackOverflowException e) { Console.WriteLine("Error caught: {0}", e); } } }The output is
Error caught: System.StackOverflowException: Exception of type System.StackOverflowException was thrown.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0