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