title: Disable application insights in debug
body: <p>How can I disable application insights automatically when using a debug configuration and enable it only on release?<br>
  Is it possible to do this without creating another instrumentation key only for debug?
  <br><br>
  I have <code>trackevent</code> statements scattered all over the code, enclosing them inside a debug preprocessor check is not an ideal solution.</p>
  
  <p>My current solution is to set the <code>Build Action</code> of the <code>ApplicationInsights.config</code> file to <code>None</code> so that it's not copied to the project's output directory, but this isn't a process that can be automated based on the active build configuration.</p>
  
  <p>There is a Developer Mode but needs to be changed manually (if it was possible to conditionally set the config file, emptying the instrumentationkey solved problem as well). See <a href="http://apmtips.com/blog/2015/02/02/developer-mode/" rel="noreferrer">http://apmtips.com/blog/2015/02/02/developer-mode/</a>  </p>
  
  <p>Reference: <a href="http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions.aspx" rel="noreferrer">http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions.aspx</a></p>