My web.config file contains this
<compilation debug="false" targetFramework="4.0">
<assemblies>
// some assemblies
</assemblies>
</compilation>
And in my _Layout.cshtml file I have
@{#if DEBUG}
// include all css and js files
@{#else}
// include the minified and combined versions of the css and js files
@{#endif}
Problem is that the @{#if DEBUG} branch gets executed. If I change that branch to @{#if !DEBUG} then the else branch gets executed. Why is this?
Thanks.
Sachin
The Web.config
debug=""attribute does not affect preprocessor symbols.You can check for that attribute directly like this:
(You should put this in a static property in any class, then check that property in a normal
ifstatement)