Release Configuration in Managed C++ does not suppress Debug Class

G

Guest

I stumbled upon something which does not make sense "Debug class methods are
not automatically suppressed by the managed c++ compiler when the project is
build in release mode"

Create a a Project (Windiows Forms or Console) in VS2005 using Managed C++
and put a Debug:;Assert(false) or Debug::Writeline("test") in there and then
compile in Debug and release Configurations. The result is the same in both.
Debug class calls are not automatically suppressed in release configuration.

Is there some project setting that i need to set to get this to work? Any
help here is appreciated

thx
ashoo
 
M

Marcus Heege

Unfortunately not. Here is the doc [1]:

"To enable debugging in C#, add the /d:DEBUG flag to the compiler command
line when you compile your code, or add #define DEBUG to the top of your
file. In Visual Basic, add the /d:DEBUG=True flag to the compiler command
line. To provide equivalent functionality in C++, you must enclose calls to
methods of this class in a #ifdef DEBUG... #endif block. This syntax is
compiler-specific. If you are using a compiler other than the ones specified
above, you must refer to the compiler's documentation to enable conditional
compiling because of the conditional compilation attributes placed on the
methods of Debug.

"

Marcus Heege
www.heege.net
 

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