By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

tell if site is a debug build?

P: n/a
I am trying to tell if my site is running as a debug build or not in asp.net
1.1 you could say

#IF DEBUG
DO SOMETHING HERE
#ENDIF

but in ASP.NET 2.0 it seems not to work anymore... why not?! i have
debug="false" in web config and the debug code still runs...
Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On the Visual Studio menu under Build/Configuration change the active
configuration to "Release". The "debug" code will not be included in the
resulting executable.

"Brian Henry" wrote:
I am trying to tell if my site is running as a debug build or not in asp.net
1.1 you could say

#IF DEBUG
DO SOMETHING HERE
#ENDIF

but in ASP.NET 2.0 it seems not to work anymore... why not?! i have
debug="false" in web config and the debug code still runs...

Nov 19 '05 #2

P: n/a
thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any
more when you have #if debug directives in it for some reason... my #debug
code always runs release or debug build
"Brad Roberts" <Br*****************@hotmail.com> wrote in message
news:4F**********************************@microsof t.com...
On the Visual Studio menu under Build/Configuration change the active
configuration to "Release". The "debug" code will not be included in the
resulting executable.

"Brian Henry" wrote:
I am trying to tell if my site is running as a debug build or not in
asp.net
1.1 you could say

#IF DEBUG
DO SOMETHING HERE
#ENDIF

but in ASP.NET 2.0 it seems not to work anymore... why not?! i have
debug="false" in web config and the debug code still runs...

Nov 19 '05 #3

P: n/a
On Tue, 1 Nov 2005 16:51:26 -0500, "Brian Henry" <no****@nospam.com>
wrote:
thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any
more when you have #if debug directives in it for some reason... my #debug
code always runs release or debug build


Right - those options aren't available in 2.0.

Are you using a filed based web site or one in IIS? I can see my code
not executing inside #if DEBUG if I turn debugging off and run with
CTRL-F5. Perhaps you could clean out the Temporary ASP.NET files
directory and see what happens.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #4

P: n/a
ron
I'm having the same problem. Using the compiler directive #IF DEBUG
around my code, works when debugging, but when I set the

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

in web.config for release build, the debug statements still run, ie the
DEBUG constant is still set to true.

Any thoughts or alternative solutions anyone?

Scott Allen wrote:
On Tue, 1 Nov 2005 16:51:26 -0500, "Brian Henry" <no****@nospam.com>
wrote:
thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any
more when you have #if debug directives in it for some reason... my #debug
code always runs release or debug build


Right - those options aren't available in 2.0.

Are you using a filed based web site or one in IIS? I can see my code
not executing inside #if DEBUG if I turn debugging off and run with
CTRL-F5. Perhaps you could clean out the Temporary ASP.NET files
directory and see what happens.

--
Scott
http://www.OdeToCode.com/blogs/scott/


Nov 19 '05 #5

P: n/a
Where do you have this #if test (in ASPX markup or in a code behing file) ?
My first thought would be that you disabled debug for ASPX pages but that
you still have in /bin a code behind DLL compiled in Debug mode...

Is this 1.1 or 2.0 ? Which compilation model are you using ?

---
Patrice
<ro*@stringx.com> a écrit dans le message de
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm having the same problem. Using the compiler directive #IF DEBUG
around my code, works when debugging, but when I set the

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

in web.config for release build, the debug statements still run, ie the
DEBUG constant is still set to true.

Any thoughts or alternative solutions anyone?

Scott Allen wrote:
On Tue, 1 Nov 2005 16:51:26 -0500, "Brian Henry" <no****@nospam.com>
wrote:
thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work anymore when you have #if debug directives in it for some reason... my #debugcode always runs release or debug build


Right - those options aren't available in 2.0.

Are you using a filed based web site or one in IIS? I can see my code
not executing inside #if DEBUG if I turn debugging off and run with
CTRL-F5. Perhaps you could clean out the Temporary ASP.NET files
directory and see what happens.

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #6

P: n/a
Here is some more information:
http://odetocode.com/Blogs/scott/arc...1/15/2464.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 1 Nov 2005 15:24:01 -0500, "Brian Henry" <no****@nospam.com>
wrote:
I am trying to tell if my site is running as a debug build or not in asp.net
1.1 you could say

#IF DEBUG
DO SOMETHING HERE
#ENDIF

but in ASP.NET 2.0 it seems not to work anymore... why not?! i have
debug="false" in web config and the debug code still runs...


Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.