码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2016-05-20 19:16:47      阅读:758      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!