.net - How to add a value using Web.Release.config -
in web.config have:
<appsettings> <add key="version" value="1" /> </appsettings>
in web.release.config
<appsettings> <add key="approot" value="/root" xdt:transform="insert" /> </appsettings>
in app_code\globalval.cshtml
public static readonly string approot = system.configuration.configurationmanager.appsettings["approot"];
then change project settings use release build profile.
the value @globalval.approot
null though. after build , publish machine still null.
how build using optional approot value using visual studio 2013 mvc application?
[update]
press play in visual studio , set breakpoint right after setting approot in globalval.cshtml. build output contains: build started: project: yourapp, configuration: release cpu ------
but approot still null.
you need specify transform needs take place (e.g. insert in case):
<appsettings> <add key="approot" value="/dirofproduction" xdt:transform="insert" /> </appsettings>
Comments
Post a Comment