title: Foolproof Debug Vs Release
body: <p>I am worried myself and the rest of my team will forget to switch the Solution Configuration drop down in VS from release to debug when debugging applications.</p>
  
  <p>We have <code>#If DEBUG</code> checks littered through the code base to keep Emails, DB data changes, and File system changes from occurring (Slowly being refactored  using DI).</p>
  
  <p>I've been contemplating using MSBuild or TFS to create a config file with some setting that indicates a release build.  This config file wouldn't be checked in.  The problem I see here is that if we deploy our apps and for whatever reason the config file is missing the apps will be silently writing to our dev dependencies. </p>
  
  <p>We would also like to have the option to be able to run in a staging environment as well.</p>
  
  <p>Is there a better way to handle this so that developers aren't an F5 away from writing to production or so that we don't deploy debug code to production?</p>