Is Debug Mode Evil?
"On April 29, 1974 when the US Congress refused to authorize emergency funding to support our ally the South Vietnamese, that's when I stopped being a Liberal." --Mort Kondracke One of the difficulties in working with .NET, especially ASP.NET, is being able to determine whether an assembly has been compiled in Debug Mode or Release Mode, and especially whether an application is running in Debug Mode (e.g. debug="true" in the compilation element of web.config). This also applies to the Page level attribute, debug="true", in the @Page directive. It is definitely evil if a production app is being run in debug mode - it will use a lot more memory, stuff that should be cached will not be cached, and a half dozen other generally "evil" things. Recently I chimed in on a post by MVP Rick Strahl where he posts some code to determine "runtime" debug status via the HttpContext: if (!HttpContext.Current.IsDebuggingEnabled) Script = Optim...