title: Disable resharper warnings that are dependent on build type
body: <p>I'm using belt and suspenders type checking for potential null object problems.  Resharper isn't playing nicely though.  In a debug build it marks the <code>if (button != null)</code> check as always true and puts a warning marker in the sidebar.  In a release build it shades the <code>Debug.Assert</code> as never used code, although at least it's smart enough not to clutter the sidebar this time.</p>
  
  <p>I don't want to disable the always true/false resharper warning globally because it can indicate a problem in the code.  At the same time having to clutter my code up with <code>ReSharper disable/restore ConditionIsAlwaysTrueOrFalse</code> comments every time I do a check is ugly.  </p>
  
  <p>Is there an option somewhere in ReSharper 5.1 to disable build type contingent behavior so that the if isn't marked in debug builds, without preventing the warning from being shown if an <code>Assert</code> isn't present?</p>
  
  <pre><code>//This should always work unless the columns are fiddled with.
  LinkButton button = e.Row.Cells[5].FindControl( "linkButtonName" ) as LinkButton;
  
  //if this isn't the case in a debug build have VS throw an error in the devs face
  Debug.Assert(button != null);
  
  //Don't let anything go boom in production if an error isn't caught in dev
  if (button != null)
      button.Visible = ( schedule.CreatedBy == Authentification.GetLoggedInUser() );
  </code></pre>