且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET Core 2.1由于环境变量而无法运行迁移

更新时间:2021-07-29 22:53:42

在运行Add-Migration命令之前,您应该可以在Package Manager控制台中设置变量,方法是键入

You should be able set the variable in the Package Manager Console before running the Add-Migration command by typing

$env:CENTRAL_APPLICATION_SETTINGS="your value"

然后运行

Add-Migration AppOneBaseMigration -Context AppDbContext -OutputDir Migrations\AppOneMigrations