Why is .NET exception not caught by try/catch block?

前端 未结 25 723
Happy的楠姐
Happy的楠姐 2020-12-04 19:24

I\'m working on a project using the ANTLR parser library for C#. I\'ve built a grammar to parse some text and it works well. However, when the parser comes across an illeg

25条回答
  •  失恋的感觉
    2020-12-04 19:58

    @spoulson,

    If you can replicate it, can you post it somewhere? One avenue you could try is usign WinDBG with the SOS extensions to run the app and catch the unhandled exception. It will break on the first chance exception (before the runtime tries to find a handler) and you can see at that point where it is coming from, and what thread.

    If you haven't used WinDBG before, it can be a little overwhelming, but here's a good tutorial:

    http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx

    Once you start up WinDBG, you can toggle the breaking of unhandled exceptions by going to Debug->Event Filters.

提交回复
热议问题