简体   繁体   中英

ASP.Net Core 2.1 ASPNETCORE_ENVIRONMENT value not reflecting

I have ASP.Net Core 2.1 API app. It is supposed to host in 4 environments.

  1. Development
  2. Testing
  3. Staging
  4. Production

When running the app in local from Visual Studio, the app is rightly fetching the ASPNETCORE_ENVIRONMENT variable & accordingly fetching the values from appsettings.Development.json

本地开发机

But when the same deployed in a VM, it's not fetching the environment & looking for settings (like Connection string etc.) from appsettings.json.

测试环境

What else settings I need to do so?

Thanks!

您应该设置系统环境变量而不是用户变量。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM