Conditional compiling C#

M

Magne Ryholt

Using VS.net 2003 (C#)

Code:
:
#if DEBUG
something
#else
something else
#endif

When I switch the build configuration to release, the code in the #if DEBUG
path is still compiled (and executed)
I have checked the "Conditional Compilation Constants" in the project
properties settings, and they look ok
(DEBUG; TRACE for debug and TRACE for release)

Any ideas ?
 
B

Brendan Grant

When you switch between debug and release mode... does the
colorization of the two code blocks (separated by the
#else) change at all?

Any chance that you are accidentally defining DEBUG
somewhere else?
 
M

Magne Ryholt

Yes they are dimmed as they should, and I found the problem.
The problem was that last night was too late :)
(I was running what I thought was the release version from the debug
directory)

Sorry to bother you, thanks anyway.
 

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

Top