Well, maybe a odd question, but how would I handle unhandled exceptions only from certain assemblies in a application, but including exceptions that originate from .NET itself, like for instance when you get a ADO.NET exception it originates from .NET assembly.
I need this because of working with the legacy application where I need unhandled exception handling only for a module consisting of several assemblies, and everything is in the same application in the end, as a part of same process.
Can I maybe catch exceptions on assembly level, instead on the global Application level ?
Just check the stack trace and use throw; if you should not handle the exception.
try
{
//something
}
catch (Exception err)
{
if (!err.StackTrace.Contains("YourAssemblyName"))
throw;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With