How to set ASP.NET 5 environment variables on production environment -


in visual studio 2015 set following variable in project properties: aspnet_env. if set development can use:

public void configure(iapplicationbuilder app, ihostingenvironment env) {     if (env.isdevelopment())     {         app.useerrorpage();     }  } 

isdevelopment method check aspnet_env environment variable. on development while in visual studio 2015. when publish web application iis on production server how can set value aspnet_env?

my server windows server 2012

if using iis host application, it's possible set environment variables in web.configfile this:

<aspnetcore processpath="%launcher_path%" arguments="%launcher_args%" stdoutlogenabled="false" stdoutlogfile=".\logs\stdout" forwardwindowsauthtoken="false">     <environmentvariables>         <environmentvariable name="aspnetcore_environment" value="qa" />         <environmentvariable name="anothervariable" value="my value" />     </environmentvariables> </aspnetcore> 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -