title: Publish in debug mode but compiler removes code inside #if debug
body: <p>I'm only publishing in debug mode to test on my local machine and I was hoping the '#if debug' mode would work so that I could test features that I don't want in production yet.</p>
  
  <p>When I publish in debug mode the web.config still has</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>but when I use reflector on the project's dll the code that was like this</p>
  
  <pre><code>#if debug
      PlaceHolder1.Visible = true;
  #endif
  </code></pre>
  
  <p>is non-existent. I figure the compiler has removed it.</p>
  
  <p>NOTE: I'm NOT talking about a build, I'm talking about publishing. Doing a debug build works as I expect it to with the code above still present</p>
  
  <p>Is this expected behavior? Is there a way to get the compiler to include those bits of code when I'm publishing in debug mode? Am I going about this all wrong?</p>
  
  <p><strong>Update:</strong>
  In response to @dash's comment my Package/Publish Web settings are:</p>
  
  <p><img src="https://i.stack.imgur.com/95F4F.png" alt="Package/Publish Web settings"></p>