IIS does not use user environment variables

I am deploying the .NET Core application twice to the same server, once for QA and once for Production. Currently, each of them uses a different local user to start the IIS application pool and sets the ASPNETCORE_ENVIRONMENT variables for "qa" and "production", respectively.

This does not work, both sites start the production configuration, which I understand by default.

Things I've looked so far:

  • I can log in as each user, and the variables are set correctly.
  • There is no system level env var parameter set, although it is assumed that user vars levels override it if it was.
  • I see processes running as the correct users in the task manager.
  • I restarted the whole system after installing env vars

It just seems like .NET is ignoring an environment variable.

Has anyone else been able to get the user level env vars working with deploying the .NET kernel?

Additional information: I can set ASPNETCORE_ENVIRONMENT at the system level, and both sites pick it up and run with it. Doing this without a system variable just doesn't work.

0
source share
1 answer

If you want to use user-specific environment variables, then the application pool setting LoadUserProfile should be set to true (false is the default value),

What exactly happens when I install the LoadUserProfile of the IIS pool?

0
source

All Articles