title: Checking for compiler constants in app.config
body: <p>In my C# project, I have little bits of code here and there that look something like this:</p>
  
  <pre><code>#if DEV
  DoStuff();
  #else
  DoOtherStuff();
  #endif
  </code></pre>
  
  <p>These enable me to deploy two slightly-different versions of my application. </p>
  
  <p>I use <code>log4net</code> to log information to a text file, and I'd like to change the logging level for different versions of my application. Normally, such a thing is controlled in the <code>app.config</code> file, like so:</p>
  
  <pre><code>&lt;log4net&gt;
    &lt;logger name="MyNamespace.MyClass"&gt;
      &lt;level value="DEBUG"/&gt;
    &lt;/logger&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>Is there a way to accomplish what I do in my C# source files in <code>app.config</code>? To illustrate, I'd like to essentially do this:</p>
  
  <pre><code>&lt;log4net&gt;
    &lt;logger name="MyNamespace.MyClass"&gt;
  #if DEV
      &lt;level value="DEBUG"/&gt;
  #else
      &lt;level value="INFO"/&gt;
  #endif
    &lt;/logger&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>Is there a way to check for arbitrary compiler constants in <code>app.config</code>?</p>