How to get the Development/Staging/production Hosting Environment in ConfigureServices
Asked 07 September, 2021
Viewed 2.1K times
  • 60
Votes

How do I get the Development/Staging/production Hosting Environment in the ConfigureServices method in Startup?

public void ConfigureServices(IServiceCollection services)
{
    // Which environment are we running under?
}

The ConfigureServices method only takes a single IServiceCollection parameter.

14 Answer