title: Why Conditional attribute methods aren't allowed to return other than void
body: <p>I've recently started to learn C# with a good book and now read about the <code>Conditional</code> attribute and the <code>#if</code> compiler directive.</p>
  
  <p>I know the usage of the <code>#if</code> compiler directive:</p>
  
  <pre><code>#if DEBUG
  public void foo(int value)
  { ... }
  #endif
  </code></pre>
  
  <p>and of the <code>Conditional</code> attribute:</p>
  
  <pre><code>[System.Diagnostics.Conditional("DEBUG")]
  public void foo(int value)
  { ... }
  </code></pre>
  
  <p>I also know that the code that is encased by the <code>#if</code> ... <code>#endif</code> statements doesn't reach the IL but the <code>Conditional</code> attribute code does and the calls to that function will be ommited.</p>
  
  <p><strong>My question:</strong><br>
  Why there is the restriction about the <code>Conditional</code> attribute usage that functions marked with that attribute have to return <code>void</code> as <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute" rel="noreferrer">written here in the documentation</a>?</p>
  
  <blockquote>
    <p>You will get a compilation error in Visual Studio if you apply this attribute to a method that does not return void. </p>
  </blockquote>
  
  <p>I already searched for information but found no explanation.</p>