同个项目写webservice引用EF出现的问题

 错误1:

定的架构无效。错误: DataModel.ssdl(2,2) :

错误 0152: 未找到具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序的实体框架提供程序。请确保在应用程序配置文件的“entityFramework”节中注册了该提供程序。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?

解决办法,将以下代码添加至web.config配置文件中即可:

  <entityFramework>

    <providers>

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

    </providers>

  </entityFramework>

 引用:

 

 

 

 

 

错误2:无法读取配置节“entityFramework”,因为它缺少节声明

<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

 

posted @ 2017-01-07 12:13  【唐】三三  阅读(649)  评论(0编辑  收藏  举报