在包管理器中运行enable-migration命令时出错

时间:2014-07-14 20:30:47

标签: asp.net-mvc entity-framework asp.net-mvc-5 ef-migrations

我正在运行命令:

  

"启用 - 迁移-ContextTypeName GiftContex -StartUpProjectName   GiftExchange -ConnectionStringName GiftExchangeEntities"

运行后我收到一条错误消息:

  

System.InvalidOperationException:实体框架提供程序类型   ' System.Data.Entity.SqlServer.SqlProviderServices,   EntityFramework.SqlServer'在应用程序配置文件中注册   对于具有不变名称的System.Data.SqlClient'的ADO.NET提供程序   无法加载。确保程序集限定名称   已使用,并且程序集可供正在运行的应用程序使用。

我在我的数据层中安装了实体框架6.1.1,层I' m"启用迁移"来自,似乎我指向正确的连接字符串,但我不确定为什么它无法启用迁移并在我的数据层项目中创建initfile和配置文件?

我在mvc项目的web.config文件中有这段代码:

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory,
 EntityFramework" />
<providers>
  <provider invariantName="System.Data.SqlClient"     type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>

0 个答案:

没有答案
相关问题