ASP.NET Core hosting environment variable ignored

前端 未结 5 724
梦毁少年i
梦毁少年i 2020-12-31 03:20

I have two web sites on my staging server, and both are ASP.NET Core sites that run in IIS. I have set the environment variable ASPNETCORE_ENVIRONMENT to

5条回答
  •  渐次进展
    2020-12-31 04:17

    As said in this similar question, the trick was simply to set the app pool to load the user variables (IIS -> Server -> App Pools -> Right click on pool -> Set application pool defaults... -> Load User Profile = True).

    I configured only one of my app pools accordingly, thus only one of the sites could access the environment variables.

提交回复
热议问题