Asp.net Reference topics Exception handling

In my 3.5.net web application, I have a background thread that does a lot of work (the application is similar to mint.com in that it does a lot of account aggregation in the background thread). I do extensive exception handling on the aggregation thread, but there is always a chance that the unhandled exception will be thrown and my whole application will die. I have read some articles on this topic, but they all look rather outdated, and none of them take a standard approach. Is there a standard approach to this now? Is there a better way to handle this in ASP.NET 4.0?

+3
source share
2 answers

You can always put a try / catch block around a workflow at a very high level ... as straight as when the thread starts. I guess this is what you are already doing, or something like that. But just keep in mind that you definitely don't want to turn an unknown error into a silent unknown error, because then it will be much harder to track when something goes wrong. Make sure you register the exception in EventLog or in your custom application log if you just want to catch it and forget it.

Aaronaught, , - . , / , ( , , , ) " - ASP.NET, , ?" , , . .:)

+1

, , . , / , , , .

. , .NET "" - .

.NET Framework, BackgroundWorker .NET 4, , , , , . , ThreadPool Thread, .

+2

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


All Articles