How to fix the error: Schema specified is not Valid

Asked

Viewed 2,118 times

1

I modified the BD of my project and performed the update of my edmx file, but now when I try to compile the error is appearing:

No Entity Framework Provider found for the ADO.NET Provider with invariant name 'Mysql.Data.Mysqlclient'. Make sure the Provider is Registered in the 'entityFramework' Section of the application config file. See http://go.microsoft.com/fwlink/? Linkid=260882 for more information

I don’t know how to solve this problem anyone has any tips?

The webconfig of my project:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    </configSections>
    <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
    </system.web>
    <system.data>
        <DbProviderFactories>
            <remove invariant="MySql.Data.MySqlClient" />
            <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
        </DbProviderFactories>
    </system.data>
    <!--<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="bancotccEntities" connectionString="metadata=res://*/bancotcc.csdl|res://*/bancotcc.ssdl|res://*/bancotcc.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;user id=root;password=tcc2012;persistsecurityinfo=True;database=bancotcc&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

I appreciate any help.

  • Why Section about the Entity Framework is commented?

  • I was suggested to comment on this session here in the forum. after commenting I was able to connect but a validation error appeared in the savechenges method.

  • Well, then, here is not really a 'forum'. Here is a question and answer site, so the dynamic is a little different. Check this link: http://answall.com/tour. Anyway, make sure my answer helps you.

  • 1

    @user9090, remember that I helped you on this link: http://answall.com/questions/17464/como-correctr-o-erro-attributto-name-nao-recognized-no-webconfig, and remember that you should decorate your class, see the last topic "Other Influencing Factors". Because all this happened, you updated your "Edmx" and with it he erased your Attribute [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))], then, every time you upgrade you must set up your class that you inherit from DbContext and if web.config remains equal to that answer!

  • Yes I remembered now, I just didn’t know that every time I modified the bank I would have to reset the attribute.

  • @user9090, you have changed the Edmx will have to change and put the attribute again! can create a partial class and use this feature that you would not need to keep putting always! but, this would have to be another question!

Show 1 more comment

1 answer

1


The section <entityFramework> is wrong. Modify to:

<entityFramework>
  <providers>
    <provider invariantName="MySql.Data.MySqlClient"
              type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity" />
  </providers>
</entityFramework>
  • I tried but ended up appearing another error:he Entity Framework Provider type 'Mysql.Data.Mysqlclient.Mysqlproviderservices, Mysql.Data.Entity' Registered in the application config file for the ADO.NET Provider with invariant name 'Mysql.Data.Mysqlclient' could not be Loaded. Make sure that the Assembly-Qualified name is used and that the Assembly is available to the running application. See http://go.microsoft.com/fwlink/? Linkid=260882 for more information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.