摘要:
EF使用CodeFirst,当使用localDB时,删除mdf文件,会报“Cannot attach the file ‘{0}' as database '{1}'”错误。 解决方法如下: 1、打开Visual Studio 命令提示 2、sqllocaldb.exe stop v11.0 3、s 阅读全文
摘要:
异常信息 解决方法: 1、PM> Enable-Migrations 2、打开生成的Configuration.cs文件,修改代码如下 public Configuration() { AutomaticMigrationsEnabled = true;//默认为false 此处需要修改 Conte 阅读全文