【发布时间】:2018-05-24 18:52:00
【问题描述】:
我正在尝试更新我的数据库,但 dotnet ef database update 使用了错误的 ASPNETCORE_ENVIRONMENT
在日志中我看到了这个Using environment 'Development' instead ofLocal`
这是我的命令:
dotnet ef database update --startup-project ../API --configuration Local --verbose
"Local": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
}
},
我也尝试使用--environment Local,但environment 未定义为选项,即使https://github.com/aspnet/EntityFrameworkCore/issues/7353 另有说明
【问题讨论】:
-
在
Update-Database之前运行$Env:ASPNETCORE_ENVIRONMENT = "Local" -
你也加了答案,我来晚了
标签: .net entity-framework entity-framework-core