元素“ entityFramework”具有无效的子元素“提供者”。可能的元素列表:“上下文” [英] The element 'entityFramework' has invalid child element 'providers'. List of possible elements expected: 'contexts'

查看:120
本文介绍了元素“ entityFramework”具有无效的子元素“提供者”。可能的元素列表:“上下文”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据教程。我正在使用带有WCF支持的EF 5.x DbContext Generator。当我尝试调试服务时,收到此警告,阻止了它运行:

I am trying to return an entity object from entity framework 5.0.0 in a WCF service according to this tutorial by Rainer Stropek. I am using EF 5.x DbContext Generator with WCF Support. When I try to debug the service, I get this warning, which prevents it from running:


元素'entityFramework'具有无效的子元素提供者。可能的元素列表:上下文。 F:\Dropbox\KelesoftSOMA\KelesoftSOMA.DataService.Administration\Web.config 40 6 KelesoftSOMA.DataService.Administration

The element 'entityFramework' has invalid child element 'providers'. List of possible elements expected: 'contexts'. F:\Dropbox\KelesoftSOMA\KelesoftSOMA.DataService.Administration\Web.config 40 6 KelesoftSOMA.DataService.Administration

web.config文件如下所示:

The web.config file looks like this:

...
<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>


...

...

请帮帮我。

推荐答案

这是我在运行vs-2013预览时发生的

This happened to me running vs-2013 preview.

由EFTools.msi安装的App.config / Web.config IntelliSense文件应更新为包括有效的EF6元素。 web / app.config文件中用于验证 EF配置部分的xsd无法识别新添加的EF6元素。应该对其进行更新,以使其不显示有效EF6配置文件的花键。

The App.config/Web.config IntelliSense files that get installed by EFTools.msi should be updated to include valid EF6 elements. The xsd for "validating" EF config section in web/app.config file does not recognize newly added EF6 elements. It should be updated so that it does not show squiggles for valid EF6 config file.

更新配置xsd以识别EF6中添加的元素(即)。这些文件位于Visual Studio安装区域中,例如〜 C:\Program Files(x86)\Microsoft Visual Studio 12.0\Xml\Schemas。这还不是100%完成-抱歉,我处于时间框模式。

Update the config xsd to recognize the elements added in EF6 (i.e. ). These files are located in the Visual Studio install area like ~ "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Xml\Schemas". This is not a 100% complete - sorry I am in time-box mode.

这篇关于元素“ entityFramework”具有无效的子元素“提供者”。可能的元素列表:“上下文”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆