title: C# !Conditional attribute?
body: <p>Does C# have a <em>not</em> <code>Conditional</code> (<code>!Conditional</code>, <code>NotConditional</code>, <code>Conditional(!)</code>) attribute?</p>
  
  <hr>
  
  <p>i know C# has a <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute" rel="noreferrer"><code>Conditional</code> attribute</a>:</p>
  
  <pre><code>[Conditional("ShowDebugString")]
  public static void ShowDebugString(string s)
  {
     ...
  }
  </code></pre>
  
  <p>which is equivalent<sup>1</sup> to:</p>
  
  <pre><code>public static void ShowDebugString(string s)
  {
  #if ShowDebugString
     ...
  #endif
  }
  </code></pre>
  
  <p>But in this case i want the <em>inverse</em> behavior (you have to specifically <em>opt out</em>):</p>
  
  <pre><code>public static void ShowDebugString(string s)
  {
  #if !RemoveSDS
     ...
  #endif
  }
  </code></pre>
  
  <p>Which leads me to try:</p>
  
  <pre><code>[!Conditional("RemoveSDS")]
  public static void ShowDebugString(string s)
  {
     ...
  }
  </code></pre>
  
  <p>which doesn't compile. And:</p>
  
  <pre><code>[Conditional("!RemoveSDS")]
  public static void ShowDebugString(string s)
  {
     ...
  }
  </code></pre>
  
  <p>which doesn't compile. And:</p>
  
  <pre><code>[NotConditional("RemoveSDS")]
  public static void ShowDebugString(string s)
  {
     ...
  }
  </code></pre>
  
  <p>which doesn't compile because it's only wishful thinking.</p>
  
  <p><sup>1</sup> <a href="http://blogs.msdn.com/b/oldnewthing/archive/2011/11/07/10234436.aspx" rel="noreferrer">Not true, but true enough. Don't make me bring back the Nitpicker's Corner.</a> <sup><a href="https://web.archive.org/web/20111110161740/http://blogs.msdn.com/b/oldnewthing/archive/2011/11/07/10234436.aspx" rel="noreferrer"></a></sup></p>