visual studio 2010 - How do I setup new compilation symbols in a MVC application? -
here's setup compilation release , debug. if want create compilation build client called "clientx" , "clienty".
so need setup clientx.debug, clientx.release , clienty.debug, clienty.release. how setup these symbols in visual studio 2010? in order #if (clientx.debug) work?
extension code check release build:
public static bool isreleasebuild(this htmlhelper helper) { #if debug return false; #else return true; #endif }
how used view (razor syntax):
@if(html.isreleasebuild())
***** update made following changes:******
open project's property pages dialog box. click configuration properties folder. click build property page. modify conditional compilation constants property.
i created following: ams_debug, ams_release, gm_release , gm_debug
i added following code in layout pages:
@{ #if (ams_debug) layout = "~/views/shared/_amslayout.cshtml"; #else layout = "~/views/shared/_gmlayout.cshtml"; #endif }
for reason, never hits ams_debug?
Comments
Post a Comment