Have tried adding this to web.config 

&lt;compilation debug="false" targetFramework="4.0"&gt;
&lt;/compilation&gt;


but website still executes code in #if DEBUG when it shouldn't

*Wierdly the inline statement &lt;% #if DEBUG %> on aspx files works but require also for .cs code. 

NB development and live website on same box


Question: Changing PhD topic and effect on career
Answer: Most people won't care.

The time to PhD isn't really considered all that important unless it's highly anomalous (much shorter or longer than standard), and if you get good publications out of it, nobody is going to make a big deal about switching topics. It happens for all kinds of reasons—funding changes, or because the original project doesn't pan out for whatever reason (technical or logistical). 

It will also not impact your career much, unless you're planning to continue studying one of those areas as your post-graduation career. Again, the overall quality tends to matter much more than the actual topic in most cases (particularly if you're moving into a different area from your graduate work).