首页 > 数据库技术 > 详细

vs2013, EF6.0.0.0 使用Migrations来更新数据库时报错

时间:2016-05-20 19:15:33      阅读:246      评论:0      收藏:0      [点我收藏+]

1、vs中,程序包管理器控制台

2、执行,Enable-Migrations

报错:

Migrations have already been enabled in project ‘dd‘. To overwrite the existing migrations configuration, use the -Force parameter.

3、执行,Enable-Migrations -Force

报错:

The migrations configuration type ‘dd.Configuration‘ was not be found in the assembly ‘dd‘.

原因:

执行这个命令时,程序会首先去本地的GAC目录Assembly中找该配置文件,如果之前部署的程序里面不包含这个configuration,那么就会出现上面这个错误。

当然,网上也可以找到其他的一些解决方案,但查到的方法都不适用我的这种情况。

4、删除GAC目录下对应的程序集(或者剪切到其他的文件夹里),再次执行,Enable-Migrations -Force,发现可以了。:)

 

vs2013, EF6.0.0.0 使用Migrations来更新数据库时报错

原文:http://www.cnblogs.com/lishidefengchen/p/5512810.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!