Publish to IIS, setting Environment Variable
Asked 07 September, 2021
Viewed 2.9K times
  • 67
Votes

Reading these two questions/answers I was able to run an Asp.net 5 app on IIS 8.5 server.

Asp.net vNext early beta publish to IIS in windows server

How to configure an MVC6 app to work on IIS?

The problem is that the web app is still using env.EnvironmentName with value Development even when run on IIS.

Also, I want to run two versions of the same Web (Staging, Production) on the same server, so I need a method to set the variable for each Web separately.

How to do this?

17 Answer