A preferred way to check if asp.net web application is in debug mode during runtime?

asp.net, c#, web-config

Solution

`HttpContext.IsDebuggingEnabled`

https://learn.microsoft.com/en-us/dotnet/api/system.web.httpcontext.isdebuggingenabled

Problem

During compile time I can do a check like ``` #if DEBUG Log("something"); #endif ``` But what would be the preferred to check if `debug="false"` is set in Web.config during runtime?

Original source

Related problems