How do I get the Development/Staging/production Hosting Environment in the ConfigureServices method in Startup?
public void ConfigureServices(IS
Since there is no full copy & paste solution yet, based on Joe Audette's answer:
public IWebHostEnvironment Environment { get; }
public Startup(IWebHostEnvironment environment, IConfiguration configuration)
{
Environment = environment;
...
}
public void ConfigureServices(IServiceCollection services)
{
if (Environment.IsDevelopment())
{
// Do something
}else{
// Do something
}
...
}