-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
WebThreadInformation.xml
285 lines (242 loc) · 15.6 KB
/
WebThreadInformation.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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<Type Name="WebThreadInformation" FullName="System.Web.Management.WebThreadInformation">
<TypeSignature Language="C#" Value="public sealed class WebThreadInformation" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit WebThreadInformation extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Web.Management.WebThreadInformation" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class WebThreadInformation" />
<TypeSignature Language="F#" Value="type WebThreadInformation = class" />
<TypeSignature Language="C++ CLI" Value="public ref class WebThreadInformation sealed" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides information about the state of a thread in an ASP.NET process.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. The <xref:System.Web.Management> namespace contains the health-event types responsible for packaging application health-status data and the provider types responsible for processing this data. It also contains supporting types that help during the management of health events.
Instances of the <xref:System.Web.Management.WebThreadInformation> class contain information that is obtained using either the <xref:System.Web.Management.WebErrorEvent> type or the <xref:System.Web.Management.WebRequestErrorEvent> type.
Your application needs the appropriate permissions to access protected information provided by this type.
> [!NOTE]
> In most cases you will be able to use the ASP.NET health-monitoring types as implemented, and you will control the health-monitoring system by specifying values in the `healthMonitoring` configuration section. You can also derive from the health-monitoring types to create your own custom events and providers. For an example of creating a custom event class, see the example provided in this topic.
## Examples
The following code example has two parts. The first is an excerpt of a configuration file that enables ASP.NET to use a custom event that uses the <xref:System.Web.Management.WebThreadInformation> type. The second shows how to implement the custom event that uses the <xref:System.Web.Management.WebThreadInformation> type.
Ensure that your custom event is raised at the proper time, that is, when the equivalent system health event it replaces would be raised.
```
<healthMonitoring
heartBeatInterval="0" enabled="true">
<profiles>
<add name="Custom"
minInstances="1"
maxLimit="Infinite"
minInterval="00:00:00" />
</profiles>
<eventMappings>
<add
name="SampleWebThreadInformation"
type="SamplesAspNet.SampleWebThreadInformation,webthreadinformation, Version=1.0.1782.29648, Culture=neutral, PublicKeyToken=b3283a2de7dd3f27, processorArchitecture=MSIL" />
</eventMappings>
<rules>
<add name="Custom Web Thread Info Event"
eventName="SampleWebThreadInformation"
provider="EventLogProvider"
profile="Custom" />
</rules>
</healthMonitoring>
```
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/VB/webthreadinformation.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.Management.WebErrorEvent" />
<altmember cref="T:System.Web.Management.WebRequestErrorEvent" />
<altmember cref="T:System.Web.Management.WebManagementEvent" />
<related type="Article" href="https://msdn.microsoft.com/library/e003f224-70fe-4cd8-a71a-2dc81e2d7e4c">ASP.NET Health Monitoring Overview</related>
</Docs>
<Members>
<Member MemberName="FormatToString">
<MemberSignature Language="C#" Value="public void FormatToString (System.Web.Management.WebEventFormatter formatter);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void FormatToString(class System.Web.Management.WebEventFormatter formatter) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Management.WebThreadInformation.FormatToString(System.Web.Management.WebEventFormatter)" />
<MemberSignature Language="VB.NET" Value="Public Sub FormatToString (formatter As WebEventFormatter)" />
<MemberSignature Language="F#" Value="member this.FormatToString : System.Web.Management.WebEventFormatter -> unit" Usage="webThreadInformation.FormatToString formatter" />
<MemberSignature Language="C++ CLI" Value="public:
 void FormatToString(System::Web::Management::WebEventFormatter ^ formatter);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="formatter" Type="System.Web.Management.WebEventFormatter" />
</Parameters>
<Docs>
<param name="formatter">The <see cref="T:System.Web.Management.WebEventFormatter" /> that contains the tab and indentation settings used to format the Web health event information.</param>
<summary>Formats thread-related information.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Management.WebThreadInformation.FormatToString%2A> method provides a uniform format for event information, which is useful if the event data must be logged and later presented to the user. It is called internally when the provider invokes one of the <xref:System.Web.Management.WebBaseEvent.ToString%2A> methods.
## Examples
The following code example shows how to format custom information.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs" id="Snippet8":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/VB/webthreadinformation.vb" id="Snippet8":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsImpersonating">
<MemberSignature Language="C#" Value="public bool IsImpersonating { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsImpersonating" />
<MemberSignature Language="DocId" Value="P:System.Web.Management.WebThreadInformation.IsImpersonating" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsImpersonating As Boolean" />
<MemberSignature Language="F#" Value="member this.IsImpersonating : bool" Usage="System.Web.Management.WebThreadInformation.IsImpersonating" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool IsImpersonating { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the current thread-impersonation mode.</summary>
<value>
<see langword="true" /> if the thread is executing in impersonation mode; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows how to get the thread-impersonation mode.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/VB/webthreadinformation.vb" id="Snippet4":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="StackTrace">
<MemberSignature Language="C#" Value="public string StackTrace { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string StackTrace" />
<MemberSignature Language="DocId" Value="P:System.Web.Management.WebThreadInformation.StackTrace" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property StackTrace As String" />
<MemberSignature Language="F#" Value="member this.StackTrace : string" Usage="System.Web.Management.WebThreadInformation.StackTrace" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ StackTrace { System::String ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the current thread-managed stack trace.</summary>
<value>The thread-managed stack trace.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows how to get the thread stack trace.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/VB/webthreadinformation.vb" id="Snippet5":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ThreadAccountName">
<MemberSignature Language="C#" Value="public string ThreadAccountName { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ThreadAccountName" />
<MemberSignature Language="DocId" Value="P:System.Web.Management.WebThreadInformation.ThreadAccountName" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ThreadAccountName As String" />
<MemberSignature Language="F#" Value="member this.ThreadAccountName : string" Usage="System.Web.Management.WebThreadInformation.ThreadAccountName" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ ThreadAccountName { System::String ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the thread account name.</summary>
<value>The thread account name.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The account returned by this property might be arbitrary if the thread is executing in impersonation mode.
## Examples
The following code example shows how to get the thread account name.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/VB/webthreadinformation.vb" id="Snippet6":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ThreadID">
<MemberSignature Language="C#" Value="public int ThreadID { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 ThreadID" />
<MemberSignature Language="DocId" Value="P:System.Web.Management.WebThreadInformation.ThreadID" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ThreadID As Integer" />
<MemberSignature Language="F#" Value="member this.ThreadID : int" Usage="System.Web.Management.WebThreadInformation.ThreadID" />
<MemberSignature Language="C++ CLI" Value="public:
 property int ThreadID { int get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the current thread identifier.</summary>
<value>The current thread identifier.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Even if managed threads might not have direct mapping to the OS threads, for debugging purposes, it is always useful to isolate a specific thread where problems might exist.
## Examples
The following code example shows how to get the thread identifier.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs" id="Snippet7":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/VB/webthreadinformation.vb" id="Snippet7":::
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>