Here's my setup for compilation for Release and debug.
What if I want to create a compilation build for client called "clientX" and "ClientY".
So I need a setup for ClientX.Debug, ClientX.Release and ClientY.Debug, ClientY.Release. How do I setup these symbols in visual studio 2010? In order for #if (ClientX.Debug) to work?
Extension code to check for release build:
public static bool IsReleaseBuild(this HtmlHelper helper)
{
#if DEBUG
return false;
#else
return true;
#endif
}
How this is used for any view (razor syntax):
@if(Html.IsReleaseBuild())
***** Update I made the following changes:******
Open the project's Property Pages dialog box. Click the Configuration Properties folder. Click the Build property page. Modify the Conditional Compilation Constants property.
I created the following: AMS_Debug, AMS_Release, GM_Release and GM_Debug
I added the following code in the layout pages:
@{
#if (AMS_Debug)
Layout = "~/Views/Shared/_AMSLayout.cshtml";
#else
Layout = "~/Views/Shared/_GMLayout.cshtml";
#endif
}
For some reason, it never hits AMS_Debug?