The element 'entityFramework' has invalid child element Entity Framework

14,366

Note: While doing this you have to close visual studio.After completing all process,You have to restart Visual Studio.

Im also faced the same problem.I resolve this error by copying two files like

(1)EntityFrameworkCatalog.xml file (2)EntityFrameworkConfig_6_0_0.xsd

from https://entityframework.codeplex.com/SourceControl/latest#src/EFTools/setup/EFToolsMsi/XmlSchemas/EntityFrameworkCatalog.xml

and place those files in

"C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas" folder.

At first download the entire zip file from above link. from that extract the above two files(xml,xsd) from the below location

"src\EFTools\setup\EFToolsMsi\XmlSchemas"

and copy to

"C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas" .

Why because day by day software is updated.Because of that reason we have to work with updated softwares.

(or)

You can install the EF6 Designer for VS2012 from " http://www.microsoft.com/en-us/download/details.aspx?id=40762 " and it will update the schema that validates config files.

Share:
14,366
user2954774
Author by

user2954774

Updated on July 03, 2022

Comments

  • user2954774
    user2954774 almost 2 years

    i create new project web asp.net mvc 4 and when i go to tools -> library package manager -> manage nuget solution for package. and installed the Entity Framework. after installing warning show in list is

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

    i am using visual studio 2010 and when go to web.config there was a underline on provider tag

    </providers>
    

    due to warning occour i try my best while finding solution on like

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


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

    but fail what is the reason for this error and how to cope with.
    web.config

    <?xml version="1.0" encoding="utf-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <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" requirePermission="false" />
      </configSections>
      <appSettings>
        <add key="webpages:Version" value="2.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="PreserveLoginUrl" value="true" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
        <pages>
          <namespaces>
            <add namespace="System.Web.Helpers" />
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="System.Web.WebPages" />
          </namespaces>
        </pages>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true" />
        <handlers>
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
      </system.webServer>
      <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>
      <connectionStrings> 
      <add name="EmployeeContext"
           connectionString = "server=WALEED-PC\UOG; database=sample; Integrated Security=SSPI"
           providerName="System.Data.SqlClient"/>
      </connectionStrings>
    
    
      </configuration>