title: Using Preprocessor Directives in Visual Studio 2010 with C#
body: <p>I have a C# application that I am building with Visual Studio 2010. To help me with some of my routine tasks in the app, I wanted to set some values if I compiled the app in debug mode. Naturally, I though preprocessor directives would be a good idea. My problem is, I don't quite understand how to use them. At this time, I have a block of code that looks like this:</p>
  
  <pre><code>#define DEBUG
  
  ... // Other code in my app
  
  #if DEBUG
    myVariable = debugValue;
  #endif
  </code></pre>
  
  <p>My problem is, when I compile my app in release mode, myVariable still gets set to debugValue. It's like I'm not properly defining my preprocessor variable or I'm not configuring my compiler correctly. Can anybody explain to me what I need to do so that myVariable is only set to debugValue when I compile the app in debug mode?</p>
  
  <p>Thank you!</p>