I know that you can define the ENVIRONMENT in asp.net core. Going to Properties --> Debug --> Environment Variable
. I've added another environment DemoLocalEnvironment. The idea is to run the application in my local Windows 10 IIS
.
"MyApplication": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "DemoLocalEnvironment"
},
"applicationUrl": "http://localhost:5003"
}
After I publish the application to the appropriate folder and setup IIS, none of my conditional code is being executed, the application is even crashing.
How to tell IIS which environment the application is supposed to run under?