Make Visual Studio ignore exceptions?

前端 未结 7 2223
一个人的身影
一个人的身影 2021-01-12 02:27

I\'m using exceptions to validate a control\'s input in Silverlight 4. When I throw an invalid input exception, VS 2010 displays the popup and stops the program. I ignore th

7条回答
  •  灰色年华
    2021-01-12 02:57

    You can disable some throw block by surrounding in the block

    #if !DEBUG
           throw new Exception();
    /// this code will be excepted in the debug mode but will be run in the release 
    #endif
    

提交回复
热议问题