Home All Groups Group Topic Archive Search About

How To Detect a DEBUG run (in C#)?

Author
14 Sep 2006 3:30 PM
Harald
Hi,
I need to perform some Operations in DEBUG-Builds (C# Windows-Forms
application). How can I detect a DEBUG-Configuration and perform actions as
with the C++ directives

#ifdef _DEBUG
....
#else
....
#endif

Thanks for any hint!
Harald

Author
14 Sep 2006 3:44 PM
Vadym Stetsyak
Hello, Harald!

H> #ifdef _DEBUG
H> ...
H> #else
H> ...
H> #endif

In the same way as with C++ only instead _DEBUG use DEBUG
#if DEBUG
//do debug
#else
//do release
#endif

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

AddThis Social Bookmark Button