Debug.Assert vs Exception Throwing

前端 未结 8 1394
囚心锁ツ
囚心锁ツ 2020-12-12 10:49

I\'ve read plenty of articles (and a couple of other similar questions that were posted on StackOverflow) about how and when to use assertions, and I understood the

8条回答
  •  半阙折子戏
    2020-12-12 11:33

    Debug.Assert by default will only work in debug builds, so if you want to catch any sort of bad unexpected behavior in your release builds you'll need to use exceptions or turn the debug constant on in your project properties (which is considered in general not to be a good idea).

提交回复
热议问题