0

Is there such a possibility to process common project exeptions in one place when the project is a class library?

I want to avoid code repetition from all catches block

  • Does this answer your question? [How can I make something that catches all 'unhandled' exceptions in a WinForms application?](https://stackoverflow.com/questions/5762526/how-can-i-make-something-that-catches-all-unhandled-exceptions-in-a-winforms-a) – Tomsen Jan 23 '23 at 15:08
  • First of all, a common (or global) exception handler is not a good replacement for individual catch blocks. Because even individual catch blocks should only be used, if you can do something about/with the exception. This is never a global task. Except *maybe* logging or reporting the exception somewhere. Also, libraries should not do that. Rather - if you really think that is necessary - have a "MyLibrary.Class.Initialize()" method that you require your users (other libraries, applications) to call to set this up. Finally google "global exception handler .net" for basic information. – Christian.K Jan 23 '23 at 15:10

0 Answers0