Reputation: 2544
I don't know if it's even possible because of .NET code security, but is there a way to hook/intercept all handled and un-handled exceptions in the CLR?
There is an event AppDomain.FirstChanceException
but this only fires in the AppDomain and all sub-Apdomains. How can I get all active AppDomains running in the CLR so that I could set the FirstChanceException of all those AppDomains.
Upvotes: 1
Views: 192
Reputation: 2448
Check out new .net debugging api
nuget: https://nuget.org/packages/Microsoft.Diagnostics.Runtime
more info: http://visualstudiomagazine.com/blogs/onward-and-upward/2013/05/new-net-debugging-api-released.aspx
example: http://blogs.msdn.com/b/dotnet/archive/2013/05/01/net-crash-dump-and-live-process-inspection.aspx
here is also detailed description how to write your own debugger: http://tripleemcoder.com/2011/12/10/writing-an-automatic-debugger-in-15-minutes-yes-a-debugger/
Upvotes: 4