Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preprocessor in C# is not working correctly

#if(DEBUG)
    ......Code......
#else
    ......Code......
#endif

I have some code like this. If my application is running in Debug mode it should execute the #if(DEBUG) part, if it is running in Release mode it should execute the #else part. However, it is only executing the #if(DEBUG) part no matter which mode it is running in.

Am using WPF application with VS2010

Can anyone help me?

like image 553
Himaja Avatar asked Feb 22 '11 12:02

Himaja


1 Answers

For Debug Configuration, your project settings should look like

enter image description here

For Release they should look like this

enter image description here

Can you verify that this is the case, and let us know if it is?
If not, what is there for each configuration?

like image 60
Binary Worrier Avatar answered Oct 01 '22 15:10

Binary Worrier