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.
When I publish in debug mode the web.config still has
<system.web>
<compilation debug="true" targetFramework="4.0">
</system.web>
but when I use reflector on the project’s dll the code that was like this
#if debug
PlaceHolder1.Visible = true;
#endif
is non-existent. I figure the compiler has removed it.
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
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?
Update:
In response to @dash’s comment my Package/Publish Web settings are:

In Visual Studio:
Make sure you don’t forget to remove it before deploying to production.
Edit:

Since you are using lowercase debug you can instead of step 4 enter debug (lowercase) in “Conditional compilation symbols” in step 4: