Kgn-web
Kgn-web

Reputation: 7565

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

Local Dev Machine

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

Test Environment

What else settings I need to do so?

Thanks!

Upvotes: 2

Views: 564

Answers (1)

kapd
kapd

Reputation: 659

You should be setting System Environment Variable rather than User Variable.

Upvotes: 3

Related Questions