How to determine if compilation debug=”true” in web.config

The HttpContext.IsDebuggingEnabled property:

using System.Web;

if (HttpContext.Current.IsDebuggingEnabled) { /* ... */ }

From the documentation:

Gets a value indicating whether the current HTTP request is in debug mode[…]
true if the request is in debug mode; otherwise, false.

Leave a Comment

tech