The element 'entityFramework' has invalid child element 'providers'. List of possible elements expected: 'contexts'

十年热恋 提交于 2019-12-08 19:31:45

问题


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:

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

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>

...

Please help me out.

Than


回答1:


This happened to me running vs-2013 preview.

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.

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.



来源:https://stackoverflow.com/questions/17666574/the-element-entityframework-has-invalid-child-element-providers-list-of-pos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!