I'm deploying a .NET Core application twice to the same server, once for QA, and once for Production. Currently I have each one of them using a different local user to run the IIS App Pool and have set the ASPNETCORE_ENVIRONMENT variables to "qa" and "production" accordingly.
This doesn't appear to work, both sites run the production configuration which I understand is the default.
Things I've looked at so far:
- I can log in as each of the users, and the variables are set correctly.
- There is no system level env var set, though the user level vars are supposed to override it if there was.
- I can see the processes running as the correct users in the task manager.
- I have restarted the entire system after setting the env vars
It just appears that .NET is ignoring the environment variable.
Has anyone else managed to get user level env vars working with a .NET core deployment?
Additional Info: I can set ASPNETCORE_ENVIRONMENT at the system level, and both sites pick it up and run with it. Doing it without a system variable simply doesn't work.