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.

  1. go application in iis , choose configuration editor.
  2. select configuration editor
  3. choose system.webserver/aspnetcore (rc2 , rtm) or system.webserver/httpplatform (rc1) in section combobox
  4. choose applicationhost.config ... in from combobox.
  5. click on enviromentvariables element , open edit window.
  6. set environment variables.
  7. close window , click apply.
  8. 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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -