【发布时间】:2017-08-20 03:57:18
【问题描述】:
无论我何时何地设置ASPNET_ENV或Hosting:Environment,启动代码总是会输入
//This method is invoked when ASPNET_ENV is 'Production'
//The allowed values are Development,Staging and Production
public void ConfigureProduction(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
Configure(app);
}
到目前为止我已经尝试过什么
- 在项目属性中将
Hosting:Environment设置为Development - 在项目属性中将
ASPNET_ENV设置为Development - 在
launchSettings.json中将Hosting:Environment设置为Development - 在
launchSettings.json中将ASPNET_ENV设置为Development - 在调用
ConfigurationBuilder.GetEnvironmentVariables()之前,在Startup方法中通过Environment.SetEnvironmentVariable("ASPNET_ENV", "Development");在代码中将ASPNET_ENV设置为Development
顺便说一下,这是版本1.0.0-rc2-20143。我在这里遗漏了什么还是只是一个错误?
【问题讨论】:
标签: asp.net-core asp.net-core-mvc asp.net-core-1.0