tell if site is a debug build?

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

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...
 
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.
 
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
 
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.
 
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?
 
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


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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top