asp.net core - Publish to IIS, setting Environment Variable -
reading these 2 questions/answers able run asp.net 5 app on iis 8.5 server.
asp.net vnext beta publish iis in windows server
how configure mvc6 app work on iis?
the problem web app still using env.environmentname
value development
when run on iis.
also, want run 2 versions of same web (staging, production) on same server, need method set variable each web separately.
how this?
this answer written asp.net core rc1. in rc2 asp.net core moved generic httpplafrom handler aspnetcore specific one. note step 3 depends on version of asp.net core using.
turns out environment variables asp.net core projects can set without having set environment variables user or having create multiple commands entries.
- go application in iis , choose
configuration editor
. - select
configuration editor
- choose
system.webserver/aspnetcore
(rc2 , rtm) orsystem.webserver/httpplatform
(rc1) insection
combobox - choose
applicationhost.config ...
infrom
combobox. - click on
enviromentvariables
element , open edit window. - set environment variables.
- close window , click apply.
- done
this way not have create special users pool or create commands entries in project.json
. also, adding special commands each environment breaks "build once, deploy many times" have call dnu publish
separately each environment, instead of publish once , deploying resulting artifact many times.
updated rc2 , rtm, mark g , tredder.
Comments
Post a Comment