Conditional compile based upon Active Configuration

S

SStory

I would like to have some code compile if my Active Configuration is set to
debug and not compile if it is set to Release.

I don't want to have to remember to define a constant. I just want to
change configurations and all debug code not execute.

How is this possible.

Thanks in advance,

Shane
 
H

Herfried K. Wagner [MVP]

SStory said:
I would like to have some code compile if my Active
Configuration is set to debug and not compile if it
is set to Release.

I don't want to have to remember to define a constant.
I just want to change configurations and all debug code
not execute.

\\\
#If Debug Then
...
#End If
///

Select the project in the project explorer, select the "Project" menu ->
"Properties" -> "Configuration Settings" -> "Build" -> "Define DEBUG
constant" (translated from the German language version of VS.NET 2002).
 
S

SStory

cool , I found it.
Thre is a checkbox that says Defin Debug Constant already checked in the
debug configuration.
That is what I wanted to do.

I can't always remember to define one. This will be helpful. Keep me from
burning a CD with Debug code still in.

Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
remember, Guten Morgan,Guten tag, Guten Aben...)

Shane
 
H

Herfried K. Wagner [MVP]

SStory said:
Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
remember, Guten Morgan,Guten tag, Guten Aben...)

"Guten Abend", "Guten Tag", "Guten Morgen"

;-)
 

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