It is my understanding that under the Project->Properties->Build settings there is a 'Define DEBUG constant'. By default the "Debug" configuration has this option checked, which means that '#if DEBUG' should evaluate to try. Also by default the "Release" configuration has this option not checked.
I am programming under vs2010 sp1 in a MVC 3 application and the following is what i have done:
@{
#if DEBUG
<script language="javascript" type="text/javascript">
$(document).ready(function () {
// put all your jQuery goodness in here.
alert('Debug Build');
});
</script>
#else
<script language="javascript" type="text/javascript">
$(document).ready(function () {
// put all your jQuery goodness in here.
alert('Release Build');
});
</script>
#endif }
My problem is that regardless of the build type, Release or Debug, i am getting the alert for 'Debug Build'.
What am i doing wrong?