Answer the question
In order to leave comments, you need to log in
How to handle all unhandled exceptions in C#?
I have a project in c#. A dll library, also written in c#, is connected to it.
At the same time, unhandled exceptions sometimes occur in the bowels of the library, which do not affect the operation of the program, but, of course, users do not like the standard CLR message about an unhandled exception.
You must handle all unhandled exceptions on all threads, and log error messages while preventing the standard unhandled exception message from appearing.
Thank you in advance.
Answer the question
In order to leave comments, you need to log in
Andrew1000000 ,
when I write C# dlls, all my functions either return Exception or accept errors themselves in out variables.
A stupid, simple and guaranteed working solution is to introduce try catch into every function.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question