Making sure your application is not left in debug="true"
You will find loads of articles around the web reminding us all that running your production ASP.NET website in complication debug=true mode is a BAD THING!
- Don't run production ASP.NET Applications with debug="true" enabled
- Beware Of Deploying Debug Code In Production
- Top 10 Best Practices for Production ASP.NET Applications
To check if the web.config has debug enabled you can use HttpContext.Current.IsDebuggingEnabled.
To check what mode a binary is in, we use the #DEBUG Preprocessor Directive:
1: // codesnippet:ADB0358E-3BD1-11DE-B2D2-764056D89593
2: public static BuildModeEnum BuildMode
   3: {           4:     get           5:     {            6: #if (DEBUG)
7: return BuildModeEnum.Debug;
8: #else
9: return BuildModeEnum.Release;
10: #endif
  11:     }      12: }Labels: asp.net, Compsoft, debug, Neil Bostrom


0 Comments:
Post a Comment
<< Home