AppDomain.FirstChanceException and stack overflow exception

前端 未结 7 1691

I\'m using the FirstChanceException event to log details about any thrown exceptions.

static void Main(string[] args)
{
    AppDomain.CurrentDomain.FirstChanceEx         


        
相关标签:
7条回答
  • 2021-02-05 11:36

    Handle inside exceptions manually e.g.

    static void Main(string[] args) {
         AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) =>
         {
             try{
             throw new Exception("Stackoverflow");} catch (Exception ex){/*manual handle*/}
         };
          throw new Exception("Exception thrown in main.");
     } 
    
    0 讨论(0)
提交回复
热议问题