#if DEBUG fails

  • Thread starter Thread starter KBS Tours Development
  • Start date Start date
K

KBS Tours Development

Hi,

I use #if DEBUG in several places in my code and I realized that when I
change the build type to Release the lines under #if DEBUG were still
executable.
In fact my production code has a lot of failures due to this problem.

Can someone tell me why it does not work in my solution?
Is there a setting that I don't know?
 
Is this a regular project? or a web-site? (they work slightly
differently). If a project, check that the symbols defined in each
mode (properties window in VS) - DEBUG should be disabled in release,
but *this is editable*.

It is also possible that your code contains an explicit #define DEBUG,
but this would be limited to individual files.

Marc
 
Hello Marc,

I have both the cases.
1. Library project which I mentioned the problem
2. Web site project where DEBUG portion is always looking like disabled but
is working.
There is really something wrong but I cannot figure it out.

By the way I tried what you've said about project setting but as I did not
change anything it is as expected, DEBUG is defined in all cases and I do
not define it for any file.

Now still, why do I have his strange behavior?
 

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