title: Conditional compilation for .NET 4
body: <blockquote>
    <p><strong>Possible Duplicate:</strong> <br/>
    <a href="https://stackoverflow.com/questions/2923210/c-sharp-conditional-compilation-and-framework-targets">Conditional compilation and framework targets</a></p>
  </blockquote>
  
  
  
  <p>I have some code that works in .NET 4, but it does not work in .NET&nbsp;3.5. In .NET&nbsp;3.5 it requires to use interop calls to Windows.</p>
  
  <p>I would like using a "ifdef" to use a different code path in both cases (eventually I will deprecate the .NET&nbsp;3.5 code).</p>
  
  <p>Is there a pre-defined directive value to identify when the code is compiled with .NET&nbsp;4?</p>
  
  <p>Is there a good link with all the predefined directives (<code>DEBUG</code>, <code>TRACE</code>, etc.)? The page below only gives the directives, but not the standard predefined values:</p>
  
  <p><em><a href="https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ed8yd1ha(v=vs.100)" rel="nofollow noreferrer">C# Preprocessor Directives</a></em></p>