我正在设置migrate.exe以在VSTS发布期间运行数据库迁移:
migrate.exe DataAccess.dll /connectionProviderName="System.Data.SqlClient" /connectionString="Data Source=SQLXXX\DEV01;Initial Catalog=XXXXX;Integrated Security=true;" /verbose
输出:
VERBOSE: Target database is: 'XXXXX' (DataSource: SQLXXX\DEV01, Provider: System.Data.SqlClient, Origin: Explicit).
No pending explicit migrations.
Running Seed method.
System.Data.Entity.Migrations.Design.ToolingException: Object reference not set to an instance of an object.
at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
at System.Data.Entity.Migrations.Console.Program.Run()
at System.Data.Entity.Migrations.Console.Program.Main(String[] args)
ERROR: Object reference not set to an instance of an object.
我们在Seed方法中没有代码。预计会No pending explicit migrations
,但我们需要脚本完成而不会出现错误,以便继续发布过程。如何解决此错误?
答案 0 :(得分:0)
为了使其工作,我必须提供/ startupConfigurationFile而不是/ connectionString。