﻿<?xml version="1.0" encoding="utf-8"?><Type Name="StackOverflowException" FullName="System.StackOverflowException" FullNameSP="System_StackOverflowException" Maintainer="ecma"><TypeSignature Language="ILASM" Value=".class public sealed serializable StackOverflowException extends System.SystemException" /><TypeSignature Language="C#" Value="public sealed class StackOverflowException : SystemException" /><TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit StackOverflowException extends System.SystemException" /><MemberOfLibrary>BCL</MemberOfLibrary><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement><Base><BaseTypeName>System.SystemException</BaseTypeName></Base><Interfaces /><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><example><para>The following example demonstrates an error that causes
      a <see cref="T:System.StackOverflowException" /> exception.</para><code lang="C#">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);
      }
   }
}
   </code><para>The output is</para><para><c>Error 
      caught: System.StackOverflowException: Exception of type
      System.StackOverflowException was thrown.</c></para></example><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para><see cref="T:System.StackOverflowException" /> is thrown for execution stack overflow errors, typically in case of a very deep or unbounded recursion. The <see cref="F:System.Reflection.Emit.OpCodes.Localloc" /> Microsoft intermediate language (MSIL) instruction throws <see cref="T:System.StackOverflowException" />.</para><para><see cref="T:System.StackOverflowException" /> uses the HRESULT COR_E_STACKOVERFLOW, which has the value 0x800703E9. For a list of initial property values for a <see cref="T:System.StackOverflowException" /> object, see the <see cref="M:System.StackOverflowException.#ctor" /> constructors.</para><block subset="none" type="note"><para>The value of the inherited <see cref="P:System.Exception.Data" /> property is always null.</para></block><format type="text/html"><h2>Version Considerations</h2></format><para>In prior versions of the .NET Framework, your application could catch a <see cref="T:System.StackOverflowException" /> object (for example, to recover from unbounded recursion). However, that practice is currently discouraged because significant additional code is required to reliably catch a stack overflow exception and continue program execution. </para><para>Starting with the .NET Framework version 2.0, a <see cref="T:System.StackOverflowException" /> object cannot be caught by a try-catch block and the corresponding process is terminated by default. Consequently, users are advised to write their code to detect and prevent a stack overflow. For example, if your application depends on recursion, use a counter or a state condition to terminate the recursive loop. Note that an application that hosts the common language runtime (CLR) can specify that the CLR unload the application domain where the stack overflow exception occurs and let the corresponding process continue. For more information, see <format type="text/html"><a href="5c834aa1-f2db-408a-b230-c7bec093d364">ICLRPolicyManager</a></format> and <format type="text/html"><a href="ea527626-99e3-4995-81c4-c8f3e60eb6d5">Hosting the Common Language Runtime</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>The exception that is thrown when the execution stack overflows because it contains too many nested method calls. This class cannot be inherited.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor()" /><MemberSignature Language="C#" Value="public StackOverflowException ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The following table shows the initial property values for an instance of <see cref="T:System.StackOverflowException" />.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>null. </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para>The localized error message string. </para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.StackOverflowException" /> class, setting the <see cref="P:System.Exception.Message" /> property of the new instance to a system-supplied message that describes the error, such as "The requested operation caused a stack overflow." This message takes into account the current system culture.</para></summary></Docs><Excluded>0</Excluded></Member><Member MemberName=".ctor"><MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string message)" /><MemberSignature Language="C#" Value="public StackOverflowException (string message);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="message" Type="System.String" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The following table shows the initial property values for an instance of <see cref="T:System.StackOverflowException" />.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>A null reference (Nothing in Visual Basic). </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para>The error message string. </para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.StackOverflowException" /> class with a specified error message.</para></summary><param name="message"><attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.String" /> that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. </param></Docs><Excluded>0</Excluded></Member><Member MemberName=".ctor"><MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string message, class System.Exception innerException)" /><MemberSignature Language="C#" Value="public StackOverflowException (string message, Exception innerException);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception innerException) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="message" Type="System.String" /><Parameter Name="innerException" Type="System.Exception" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>An exception that is thrown as a direct result of a previous exception can include a reference to the previous exception in the <see cref="P:System.Exception.InnerException" /> property. The <see cref="P:System.Exception.InnerException" /> property returns the same value that is passed into the constructor, or a null reference (Nothing in Visual Basic) if the <see cref="P:System.Exception.InnerException" /> property does not supply the inner exception value to the constructor.</para><para>The following table shows the initial property values for an instance of <see cref="T:System.StackOverflowException" />.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>The inner exception reference. </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para>The error message string. </para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.StackOverflowException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</para></summary><param name="message"><attribution license="cc4" from="Microsoft" modified="false" />The error message that explains the reason for the exception. </param><param name="innerException"><attribution license="cc4" from="Microsoft" modified="false" />The exception that is the cause of the current exception. If the <paramref name="innerException" /> parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. </param></Docs><Excluded>0</Excluded></Member></Members><TypeExcluded>0</TypeExcluded></Type>