.net - Disable try/catch in compiled assembly -
we using external api 3th party and, decompiled code, function have try/catch
empty catch
statement.
is there way disable try/catch external api (in c#)?
if license allows - decompile dll, modify exception handling code, recompile dll , use it. can use opensource tool decompiling ilspy.net
if not take @ appdomain.currentdomain.firstchanceexception
, msdn reference link raise event every exception thrown in application domain. so, firstchanceexception
event raised exception thrown.
for detail explanation examples (like 1 posted here) refer post.
example:
static void main(string[] args) { appdomain.currentdomain.firstchanceexception += (sender, eventargs) => { console.writeline("first chance exception: " + eventargs.exception.message); }; try { console.writeline("before exception."); throw new exception("some error."); } catch { console.writeline("handled."); } }
Comments
Post a Comment