473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

tell if site is a debug build?

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
6 1608
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Franks | last post by:
I'm using Visual Studio 2005 RC and cannot figure out how to produce a "release" build. Am I doing something wrong? I'm wondering if perhaps MS locked out the ability to produce a release build...
19
by: Alan Silver | last post by:
Hello, I have been developing ASP.NET with a text editor so far (better way to learn initially), and have now been trying Visual Web Developer. I want to create a project for an existing site...
8
by: Graham | last post by:
I noticed a similar post awhile ago and in terms of my problem it wasnt a suitable answer so I will ask again. I have VS2005 running a on development machine in my office where I do all my...
2
by: NH | last post by:
I am a bit confused with the difference between building and publishing a website using asp.net 2.0. Currently I build the website up to the server (in the config manager this is in "Debug"...
6
by: Eric | last post by:
I have what is hopefully a quick question. I want to have a quick and easy method for deploying my website to our test environment. I need something to do nearly the same thing as the "Publish...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
1
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got a solution that has several dll projects and a website. For the dll projects I've add a configuration 'debug - no code analysis'. Now for the website I can't create...
2
by: John Kotuby | last post by:
Hi all, I am working on what I "thought" was a Web Project in VS 2005 using VB. I have published the site to an IIS server in our office for testing. When I hit a runtime error I get a basically...
9
by: Jason | last post by:
Hi all, I am no longer able to publish a web site project using Visual Studio 2005 Professional. I am publishing it to an FTP url, and this used to work just fine. I enter the username and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.