title: Conditional compilation and framework targets
body: <p>There are a few minor places where code for my project may be able to be drastically improved if the target framework were a newer version. I'd like to be able to better leverage conditional compilation in C# to switch these as needed.</p>
  
  <p>Something like:</p>
  
  <pre><code>#if NET40
  using FooXX = Foo40;
  #elif NET35
  using FooXX = Foo35;
  #else NET20
  using FooXX = Foo20;
  #endif
  </code></pre>
  
  <p>Do any of these symbols come for free? Do I need to inject these symbols as part of the project configuration? It seems easy enough to do since I'll know which framework is being targeted from MSBuild.</p>
  
  <pre><code>/p:DefineConstants="NET40"
  </code></pre>
  
  <p>How are people handling this situation? Are you creating different configurations? Are you passing in the constants via the command line?</p>