Exclude exceptions from WS

I have a WS client written in C #. Is there a way to handle all exceptions in one place? Now the WS methods are executed in many places, so I have to write a lot of attempts ... to capture them all.

thanks

+3
source share
2 answers

using

  AppDomain.CurrentDomain.UnhandledException

before creating winform you need to add this line

 Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+1
source

svcutil.exe( Visual Studio: " " ), WCF, - (asmx). IErrorHandler. IErrorHandler.HandleError, ProvideFault .

0

Source: https://habr.com/ru/post/1720835/


All Articles