- Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathStackOverflowException.xml
265 lines (246 loc) · 17.6 KB
/
StackOverflowException.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<TypeName="StackOverflowException"FullName="System.StackOverflowException">
<TypeSignatureLanguage="C#"Value="public sealed class StackOverflowException : SystemException" />
<TypeSignatureLanguage="ILAsm"Value=".class public auto ansi sealed beforefieldinit StackOverflowException extends System.SystemException"FrameworkAlternate="net-10.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netstandard-2.0;netstandard-2.1" />
<TypeSignatureLanguage="DocId"Value="T:System.StackOverflowException" />
<TypeSignatureLanguage="VB.NET"Value="Public NotInheritable Class StackOverflowException
Inherits SystemException" />
<TypeSignatureLanguage="F#"Value="type StackOverflowException = class
 inherit SystemException" />
<TypeSignatureLanguage="C++ CLI"Value="public ref class StackOverflowException sealed : SystemException" />
<TypeSignatureLanguage="ILAsm"Value=".class public auto ansi serializable sealed beforefieldinit StackOverflowException extends System.SystemException"FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwardingFrom="netstandard"FromVersion="2.1.0.0"To="System.Runtime"ToVersion="10.0.0.0"FrameworkAlternate="net-10.0" />
<TypeForwardingFrom="netstandard"FromVersion="2.1.0.0"To="System.Runtime"ToVersion="5.0.0.0"FrameworkAlternate="net-5.0" />
<TypeForwardingFrom="netstandard"FromVersion="2.1.0.0"To="System.Runtime"ToVersion="6.0.0.0"FrameworkAlternate="net-6.0" />
<TypeForwardingFrom="netstandard"FromVersion="2.1.0.0"To="System.Runtime"ToVersion="7.0.0.0"FrameworkAlternate="net-7.0" />
<TypeForwardingFrom="netstandard"FromVersion="2.1.0.0"To="System.Runtime"ToVersion="8.0.0.0"FrameworkAlternate="net-8.0" />
<TypeForwardingFrom="netstandard"FromVersion="2.1.0.0"To="System.Runtime"ToVersion="9.0.0.0"FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.SystemException</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<AttributeFrameworkAlternate="net-10.0;net-8.0;net-9.0">
<AttributeNameLanguage="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeNameLanguage="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
<AttributeFrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeNameLanguage="C#">[System.Serializable]</AttributeName>
<AttributeNameLanguage="F#">[<System.Serializable>]</AttributeName>
</Attribute>
<AttributeFrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeNameLanguage="C#">[System.Runtime.InteropServices.ComVisible(true)]</AttributeName>
<AttributeNameLanguage="F#">[<System.Runtime.InteropServices.ComVisible(true)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>The exception that is thrown when the execution stack exceeds the stack size. This class cannot be inherited.</summary>
<remarks>
<formattype="text/markdown">< section for an illustration of this technique.
> [!NOTE]
> Applying the <xref:System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute> attribute to a method that throws a `StackOverflowException` has no effect. You still cannot handle the exception from user code.
If your app hosts the common language runtime (CLR), it can specify that the CLR should unload the application domain where the stack overflow exception occurs and let the corresponding process continue. For more information, see [ICLRPolicyManager Interface](/dotnet/framework/unmanaged-api/hosting/iclrpolicymanager-interface).
## Examples
The following example uses a counter to ensure that the number of recursive calls to the `Execute` method do not exceed a maximum defined by the MAX_RECURSIVE_CALLS constant.
:::code language="csharp" source="~/snippets/csharp/System/StackOverflowException/Overview/example1a.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/StackOverflowException/Overview/example1a.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.stackoverflowexception.class/vb/example1a.vb" id="Snippet1":::
]]></format>
</remarks>
<altmembercref="T:System.Exception" />
<relatedtype="Article"href="/dotnet/standard/exceptions/">Handling and Throwing Exceptions</related>
</Docs>
<Members>
<MemberGroupMemberName=".ctor">
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <seecref="T:System.StackOverflowException" /> class.</summary>
</Docs>
</MemberGroup>
<MemberMemberName=".ctor">
<MemberSignatureLanguage="C#"Value="public StackOverflowException ();" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignatureLanguage="DocId"Value="M:System.StackOverflowException.#ctor" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub New ()" />
<MemberSignatureLanguage="C++ CLI"Value="public:
 StackOverflowException();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <seecref="T:System.StackOverflowException" /> class, setting the <seecref="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.</summary>
<remarks>
<formattype="text/markdown"><![CDATA[
## Remarks
The following table shows the initial property values for an instance of <xref:System.StackOverflowException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|`null`.|
|<xref:System.Exception.Message%2A>|The localized error message string.|
]]></format>
</remarks>
</Docs>
</Member>
<MemberMemberName=".ctor">
<MemberSignatureLanguage="C#"Value="public StackOverflowException (string? message);"FrameworkAlternate="net-10.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:System.StackOverflowException.#ctor(System.String)" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub New (message As String)" />
<MemberSignatureLanguage="F#"Value="new StackOverflowException : string -> StackOverflowException"Usage="new System.StackOverflowException message" />
<MemberSignatureLanguage="C++ CLI"Value="public:
 StackOverflowException(System::String ^ message);" />
<MemberSignatureLanguage="C#"Value="public StackOverflowException (string message);"FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<ParameterName="message"Type="System.String" />
</Parameters>
<Docs>
<paramname="message">A <seecref="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>
<summary>Initializes a new instance of the <seecref="T:System.StackOverflowException" /> class with a specified error message.</summary>
<remarks>
<formattype="text/markdown"><![CDATA[
## Remarks
The following table shows the initial property values for an instance of <xref:System.StackOverflowException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|A null reference (`Nothing` in Visual Basic).|
|<xref:System.Exception.Message%2A>|The error message string.|
]]></format>
</remarks>
</Docs>
</Member>
<MemberMemberName=".ctor">
<MemberSignatureLanguage="C#"Value="public StackOverflowException (string? message, Exception? innerException);"FrameworkAlternate="net-10.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception innerException) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:System.StackOverflowException.#ctor(System.String,System.Exception)" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub New (message As String, innerException As Exception)" />
<MemberSignatureLanguage="F#"Value="new StackOverflowException : string * Exception -> StackOverflowException"Usage="new System.StackOverflowException (message, innerException)" />
<MemberSignatureLanguage="C++ CLI"Value="public:
 StackOverflowException(System::String ^ message, Exception ^ innerException);" />
<MemberSignatureLanguage="C#"Value="public StackOverflowException (string message, Exception innerException);"FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<ParameterName="message"Type="System.String" />
<ParameterName="innerException"Type="System.Exception" />
</Parameters>
<Docs>
<paramname="message">The error message that explains the reason for the exception.</param>
<paramname="innerException">The exception that is the cause of the current exception. If the <paramrefname="innerException" /> parameter is not a null reference (<seelangword="Nothing" /> in Visual Basic), the current exception is raised in a <seelangword="catch" /> block that handles the inner exception.</param>
<summary>Initializes a new instance of the <seecref="T:System.StackOverflowException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary>
<remarks>
<formattype="text/markdown"><![CDATA[
## Remarks
An exception that is thrown as a direct result of a previous exception can include a reference to the previous exception in the <xref:System.Exception.InnerException%2A> property. The <xref:System.Exception.InnerException%2A> property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the <xref:System.Exception.InnerException%2A> property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of <xref:System.StackOverflowException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|The inner exception reference.|
|<xref:System.Exception.Message%2A>|The error message string.|
]]></format>
</remarks>
<altmembercref="T:System.Exception" />
<relatedtype="Article"href="/dotnet/standard/exceptions/">Handling and Throwing Exceptions</related>
</Docs>
</Member>
</Members>
</Type>