带有Repository的VS2013 WebAPI 2.x突然开始寻找在数据库实例上发生的数据迁移,而不是过去3个月以来的数据库实例--EF版本6
我有SQL Server 2012(v11.0.2218.0)作为ron-hp\localdb- 这已经接受12次迁移,使用add-migration/update-database命令3个月
截至昨天:去更新 - 数据库产生消息
PM> update-database -verbose
Using StartUp project 'PartyPoochesClient'.
Using NuGet project 'PartyPooches.Repository'.
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Target database is: 'PartyPooches.Repository.Entities.PartyPoochesContext' (***DataSource: (localdb)\v12.0,*** Provider: System.Data.SqlClient, Origin: Convention).
Run Code Online (Sandbox Code Playgroud)
我从未有过v12.0的实例,只有昨天的迁移/ update-database尝试PM期望看到a (localdb)\v12.0接受更新.任何代码搜索整个解决方案,(localdb)\v12.0什么都不产生.正如预期的那样,它无法在SQL Server错误50中找到这样的实例,项目使用CodeFirst创建的DB几乎有12个迁移更新到ron-hp\localdb实例而没有问题.
代码:
internal sealed class Configuration : DbMigrationsConfiguration<PartyPooches.Repository.Entities.PartyPoochesContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
ContextKey = "PartyPooches.Repository.Entities.PartyPoochesContext";
}
protected override void Seed(PartyPooches.Repository.Entities.PartyPoochesContext …Run Code Online (Sandbox Code Playgroud) entity-framework sql-server-2012 ef-migrations asp.net-web-api