A
A
Andrew10000002012-08-21 21:39:54
Programming
Andrew1000000, 2012-08-21 21:39:54

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

4 answer(s)
W
Weageoo, 2012-08-21
@Weageoo

www.codeproject.com/Articles/7482/User-Friendly-Exception-Handling

I
Iliapan, 2012-08-21
@Iliapan

accessing them in a try...catch block

P
Pavel, 2012-10-10
@PavelMSTU

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.

@
@ngreduce, 2012-10-10
_

Enclose the program entry point with try...catch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question