Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the .NET framework setting for <compilation debug="true">

Tags:

c#

.net

debugging

In my web.config I have the standard element;

<compilation debug="true" defaultLanguage="c#">

I know I could use [Conditional("DEBUG")] on methods, or use some pre-compiler if statement like #if DEBUG, but what I am looking for is the built-in .NET framework setting that lets me know if the setting for debug in the compilation section.

I've seen it done before but can't find it or remember it.

like image 883
Dead account Avatar asked Sep 14 '25 09:09

Dead account


1 Answers

HttpContext.Current.IsDebuggingEnabled (posted by Jason Diamond) was what I was looking for.

Thanks for your help Marc!

like image 168
Dead account Avatar answered Sep 17 '25 02:09

Dead account