好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

"No Entity Framework provider found for the ADO.NE

"No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

mvc3 我分层了, dal 和网站不在一个类库中,抱着个错,原来我只是dal添加了 entityframework ,网站没添加,添加上后ok


dal中的配置文件都可以删掉,留网站中的即可。但是dal和网站都必须添加ef引用


下面是解决我实际问题的方法,限MSSQL数据库

除了引入:EntityFramework.dll 外还要引入:EntityFramework.SqlServer.dll

注意版本哦。

当然在web.config中也可以加入以下节点:

<configSections>

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

</configSections>

<entityFramework>

<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">

<parameters>

<parameter value="v11.0" />

</parameters>

</defaultConnectionFactory>

<providers>

<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />

</providers>

</entityFramework>

注意都是二级节点,可选,再强调一下,注意版本哦。


查看更多关于"No Entity Framework provider found for the ADO.NE的详细内容...

  阅读:65次