ASP.net health monitoring works with asmx web services

I am trying to use ASP.net health monitoring to register unhandled exceptions from the asmx web service. I turned on health monitoring in web.config but didn't write anything. Is health monitoring using asmx web services? I googled around and it seems that other people have asked the same question, but have not received a definite answer.

+4
source share
5 answers

Please do not post the answer if it does not answer the question asked. Half of the answers to something other than the question confuse the reader. Health monitoring has nothing to do with "really unhandled" ASP.NET exceptions or the Application_Error event.

The answer is no. I figured it out a bit, and for some reason, the exceptions that arise as part of web methods never get on the list of health care providers. Looks like you have to catch them and deal with yourself.

+9
source

There is a difference between the normal interpretation of unhandled exceptions and the ones Tom talks about. What Tom has in mind are really unhandled exceptions that will kill your w3wp.exe process (before it has the opportunity to register it), which I wrote about here: http://www.improve.dk/blog/ 2008/04/07 / spawning-threads-in-aspnet-can-be-dangerous

Normal unhandled exceptions will throw an exception and show the error page to the user / called. However, this will not crash your w3wp.exe process. These exceptions should be picked up by health monitoring.

+1
source

In Global.asax, if you use one that is automatically created by Visual Studio, you can add code to the Application_Error method to handle exceptions and register them in any way. You can also override the Init method and add an event handler for the class error event.

In any case, you only get the useless vanilla EventAgs object, but you can use HttpContext.Current.Server.GetLastError () to get the exception that raised.

As another poster is mentioned, this may not catch exceptions that are triggered by asynchronously running delegates, threads that you run yourself, or asynchronous page tasks created using Page.RegisterAsyncTask (). In this case, you always need to make sure that implementations have exceptions with return stops, so that exceptions can be detected and the IIS workflow will not be interrupted.

+1
source

This will not work because unhandled exceptions are not thrown inside any type of try / catch. Because of this, he will not be able to register it. Take a look at this blog post: http://blogs.msdn.com/tom/archive/2007/12/04/unhandled-exceptions-causing-asp-net-to-crash-in-net-2-0.aspx

0
source

CALM product should work in this case; let me know if this is not so - I wrote it; -)

0
source

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


All Articles