|
17 | 17 | <Docs> |
18 | 18 | <summary>Extend the <see cref="T:System.ServiceModel.Dispatcher.ExceptionHandler" /> class to create an exception handler for unhandled exceptions that occur within the Windows Communication Foundation (WCF) runtime.</summary> |
19 | 19 | <remarks> |
20 | | - <format type="text/markdown"><![CDATA[ |
21 | | - |
22 | | -## Remarks |
23 | | - Extend the <xref:System.ServiceModel.Dispatcher.ExceptionHandler> class and override the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> method to determine whether an exception should terminate the application. Then create a new instance of your custom <xref:System.ServiceModel.Dispatcher.ExceptionHandler> class and assign it to the static <xref:System.ServiceModel.Dispatcher.ExceptionHandler.AsynchronousThreadExceptionHandler%2A> or <xref:System.ServiceModel.Dispatcher.ExceptionHandler.TransportExceptionHandler%2A> property prior to creating WCF clients or services. |
24 | | - |
25 | | - |
26 | | - |
27 | | -## Examples |
28 | | - The following code example shows an implementation of the <xref:System.ServiceModel.Dispatcher.ExceptionHandler> abstract class that overrides the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> method. |
29 | | - |
| 20 | + <format type="text/markdown"><![CDATA[ |
| 21 | +
|
| 22 | +## Remarks |
| 23 | +
|
| 24 | +Extend the <xref:System.ServiceModel.Dispatcher.ExceptionHandler> class and override the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> method to determine whether an exception should terminate the application. Then create a new instance of your custom <xref:System.ServiceModel.Dispatcher.ExceptionHandler> class and assign it to the static <xref:System.ServiceModel.Dispatcher.ExceptionHandler.AsynchronousThreadExceptionHandler%2A> or <xref:System.ServiceModel.Dispatcher.ExceptionHandler.TransportExceptionHandler%2A> property prior to creating WCF clients or services. |
| 25 | +
|
| 26 | +## Examples |
| 27 | +
|
| 28 | + The following code example shows an implementation of the <xref:System.ServiceModel.Dispatcher.ExceptionHandler> abstract class that overrides the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> method. |
| 29 | +
|
30 | 30 | :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_ueexceptionhandler/cs/program.cs" id="Snippet0"::: |
31 | | - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_ueexceptionhandler/vb/module1.vb" id="Snippet0"::: |
32 | | - |
33 | | - The following code example shows how to enable the custom `MyExceptionHandler` for unhandled exceptions that occur within the WCF runtime. |
34 | | - |
| 31 | + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_ueexceptionhandler/vb/module1.vb" id="Snippet0"::: |
| 32 | +
|
| 33 | + The following code example shows how to enable the custom `MyExceptionHandler` for unhandled exceptions that occur within the WCF runtime. |
| 34 | +
|
35 | 35 | :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_ueexceptionhandler/cs/program.cs" id="Snippet1"::: |
36 | | - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_ueexceptionhandler/vb/module1.vb" id="Snippet1"::: |
37 | | - |
| 36 | + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_ueexceptionhandler/vb/module1.vb" id="Snippet1"::: |
| 37 | +
|
38 | 38 | ]]></format> |
39 | 39 | </remarks> |
40 | 40 | </Docs> |
|
137 | 137 | <summary>Gets or sets the current <see cref="T:System.ServiceModel.Dispatcher.ExceptionHandler" /> implementation for the application domain.</summary> |
138 | 138 | <value>Assign a custom <see cref="T:System.ServiceModel.Dispatcher.ExceptionHandler" /> object that receives unhandled exceptions that occur on asynchronous Windows Communication Foundation (WCF) threads.</value> |
139 | 139 | <remarks> |
140 | | - <format type="text/markdown"><![CDATA[ |
141 | | - |
142 | | -## Remarks |
143 | | - By default, the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.AsynchronousThreadExceptionHandler%2A> property is `null`, and unhandled exceptions on asynchronous WCF threads terminate the application. Set this property to an <xref:System.ServiceModel.Dispatcher.ExceptionHandler> object to receive and react to these exceptions. |
144 | | - |
145 | | - If an unhandled exception occurs on an asynchronous WCF thread and reaches this handler, the state of the application domain may be compromised. <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> should not return `true` for these exceptions. |
146 | | - |
| 140 | + <format type="text/markdown"><![CDATA[ |
| 141 | +
|
| 142 | +## Remarks |
| 143 | + By default, the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.AsynchronousThreadExceptionHandler%2A> property is `null`, and unhandled exceptions on asynchronous WCF threads terminate the application. Set this property to an <xref:System.ServiceModel.Dispatcher.ExceptionHandler> object to receive and react to these exceptions. |
| 144 | +
|
| 145 | + If an unhandled exception occurs on an asynchronous WCF thread and reaches this handler, the state of the application domain may be compromised. <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> should not return `true` for these exceptions. |
| 146 | +
|
147 | 147 | ]]></format> |
148 | 148 | </remarks> |
149 | 149 | </Docs> |
|
168 | 168 | <Parameter Name="exception" Type="System.Exception" /> |
169 | 169 | </Parameters> |
170 | 170 | <Docs> |
171 | | - <param name="exception">The exception the occurred within the Windows Communication Foundation (WCF) runtime and which may terminate the application.</param> |
| 171 | + <param name="exception">The exception that occurred within the Windows Communication Foundation (WCF) runtime and which might terminate the application.</param> |
172 | 172 | <summary>When overridden in a derived class, returns <see langword="true" /> if the exception has been handled, or <see langword="false" /> if the exception should be rethrown and the application terminated.</summary> |
173 | 173 | <returns> |
174 | 174 | <see langword="true" /> if the exception has been handled; otherwise, <see langword="false" />.</returns> |
175 | 175 | <remarks> |
176 | | - <format type="text/markdown"><![CDATA[ |
177 | | - |
178 | | -## Remarks |
179 | | - The <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> property returns `true` if the exception has been handled. If it returns `false` or throws a different exception, the original exception is rethrown. |
180 | | - |
181 | | - |
182 | | - |
183 | | -## Examples |
184 | | - The following code example shows an implementation of the <xref:System.ServiceModel.Dispatcher.ExceptionHandler> abstract class that overrides the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> method. |
185 | | - |
186 | | - |
187 | | - |
188 | | - The following code example shows how to enable the custom `MyExceptionHandler` for unhandled exceptions that occur within the WCF runtime. |
189 | | - |
190 | | - |
191 | | - |
| 176 | + <format type="text/markdown"><![CDATA[ |
| 177 | +
|
| 178 | +## Remarks |
| 179 | + The <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> property returns `true` if the exception has been handled. If it returns `false` or throws a different exception, the original exception is rethrown. |
| 180 | +
|
| 181 | +## Examples |
| 182 | +
|
| 183 | + The following code example shows an implementation of the <xref:System.ServiceModel.Dispatcher.ExceptionHandler> abstract class that overrides the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> method. |
| 184 | +
|
| 185 | + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_ueexceptionhandler/cs/program.cs" id="Snippet0"::: |
| 186 | + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_ueexceptionhandler/vb/module1.vb" id="Snippet0"::: |
| 187 | +
|
| 188 | + The following code example shows how to enable the custom `MyExceptionHandler` for unhandled exceptions that occur within the WCF runtime. |
| 189 | +
|
| 190 | + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/s_ueexceptionhandler/cs/program.cs" id="Snippet1"::: |
| 191 | + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/s_ueexceptionhandler/vb/module1.vb" id="Snippet1"::: |
| 192 | +
|
192 | 193 | ]]></format> |
193 | 194 | </remarks> |
194 | 195 | </Docs> |
|
223 | 224 | <summary>Gets or sets the current transport <see cref="T:System.ServiceModel.Dispatcher.ExceptionHandler" /> implementation for the application domain.</summary> |
224 | 225 | <value>A custom <see cref="T:System.ServiceModel.Dispatcher.ExceptionHandler" /> object that receives unhandled exceptions that occur within the global Windows Communication Foundation (WCF) transports.</value> |
225 | 226 | <remarks> |
226 | | - <format type="text/markdown"><![CDATA[ |
227 | | - |
228 | | -## Remarks |
229 | | - By default, the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.TransportExceptionHandler%2A> property is set to the value of <xref:System.ServiceModel.Dispatcher.ExceptionHandler.AlwaysHandle%2A>, causing unhandled exceptions within WCF transports to be ignored. Set this property to an instance of <xref:System.ServiceModel.Dispatcher.ExceptionHandler> to receive and react to these exceptions. |
230 | | - |
231 | | - If an unhandled exception occurs within a global WCF transport and reaches this handler, there is a possibility that the state of the application domain is compromised. <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> can return `false` for these exceptions to cause the application to be terminated. |
232 | | - |
| 227 | + <format type="text/markdown"><![CDATA[ |
| 228 | +
|
| 229 | +## Remarks |
| 230 | +
|
| 231 | + By default, the <xref:System.ServiceModel.Dispatcher.ExceptionHandler.TransportExceptionHandler%2A> property is set to the value of <xref:System.ServiceModel.Dispatcher.ExceptionHandler.AlwaysHandle%2A>, causing unhandled exceptions within WCF transports to be ignored. Set this property to an instance of <xref:System.ServiceModel.Dispatcher.ExceptionHandler> to receive and react to these exceptions. |
| 232 | +
|
| 233 | + If an unhandled exception occurs within a global WCF transport and reaches this handler, there is a possibility that the state of the application domain is compromised. <xref:System.ServiceModel.Dispatcher.ExceptionHandler.HandleException%2A> can return `false` for these exceptions to cause the application to be terminated. |
| 234 | +
|
233 | 235 | ]]></format> |
234 | 236 | </remarks> |
235 | 237 | </Docs> |
|
0 commit comments