How do I safely Debug.Assert in ASP.NET?
- by MatthewMartin
Asserts can't be caught. This is good because some errors I don't want to be wrapped in try/catch, at least not on the development server. But Asserts seem awefully dangerous. If they get onto production, it can hang the ASP.NET server with a msgbox.
//Don't want this on prod even if debug=true is in the web.config
#if DEBUG
//A future…