MySql and Entity Framework randomly indicate the specified schema is not a valid error

I am using Entity Framework to access my MySQL database. The model was created using EDMGEN2 and everything works great. I can fulfill all my requests to an object oriented request ...

... until an indefinite amount of time has elapsed and I get a "ProviderManifestToken" 5 'different from the "5.1" which was previously encountered with an "error". Why start with "5" when I just specified "5.1"? !!?

The only way to stop this error is to reload the edmx file (which hasn't changed at all), overwriting the previous one. At this point, the application will happily crack down on data transmission to users until the BAM error appears, perhaps a few hours, sometimes a few days, and I have to start chasing the tail again.

I tried to change ProviderManifestToken = "5.1" to "MySQL", "6", "5" and the same situation happens: works for a while and then an error occurs. As a bonus, I only have this one edmx file in the vb.net webforms application, so is it getting confused?

the first few lines of my edmx file looks like this:

<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
<edmx:Runtime>
<edmx:StorageModels>
<Schema Namespace="v2Model.Store" Alias="Self" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.1" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
  <EntityContainer Name="v2ModelStoreContainer">.....

      

and my connection string in web.config looks like this:

<add name="v2Entities" connectionString="metadata=res://*;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;database=v2;uid=username;pwd=password&quot;" providerName="System.Data.EntityClient" />

      

This has been happening for the last month and I cannot understand the source of the problem for my life! Any suggestions at all would be appreciated

The setup looks like this:

Windows Server 2003 MySQL v 5.1.38 (also tested 5.1.36) Connector / NET 6.1.1.0 (also tested 6.0.4.0)

The error is as follows:

The specified scheme is not valid. Errors: MySql.Data.Entity.Properties.SchemaDefinition-5.1.ssdl (4.9): error 0169: All SSDL artifacts must target the same provider. ProviderManifestToken '5' is different from the "5.1" that we saw earlier.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (4.9): Error 0169: All SSDL artifacts must target the same provider. ProviderManifestToken '5' is different from the "5.1" that we saw earlier.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (7,4): Error 0019: EntityContainer name must be unique. An EntityContainer named Schema is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (336,4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.Table" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (348,4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.TableColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (374,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.View" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (386.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ViewColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (412,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.Function' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (437.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.Procedure" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (447.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.Parameter' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (471,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.Constraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (483.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.CheckConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (491,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ConstraintColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (500,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ForeignKeyConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (509.4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ForeignKey" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (520,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ViewConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (535,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.TableTableConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (548,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ConstraintConstraintColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (561,4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ConstraintForeignKey" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (574.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.FromForeignKeyColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (587.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ToForeignKeyColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (600,4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.TableTableColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (613,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ViewViewColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (626.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.FunctionFunctionParameter' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (639.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ProcedureProcedureParameter" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (652,4): error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.ViewViewConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (665.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ViewConstraintConstraintColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (678.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ViewConstraintForeignKey' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (691,4): error 0019: Each type name in a schema must be unique. The type name "MySqlClient.FromForeignKeyViewColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl (704,4): error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ToForeignKeyViewColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (4.9): error 0169: All SSDL artifacts must target the same provider. ProviderManifestToken '5' is different from the "5.1" that we saw earlier.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (7,4): Error 0019: EntityContainer name must be unique. An EntityContainer named Schema is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (391,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.Table" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (403,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.TableColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (429.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.View" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (441,4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ViewColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (467.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.Function' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (492,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.Procedure" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (502.4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.Parameter' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (526,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.Constraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (538,4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.CheckConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (546,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.ConstraintColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (555,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.ForeignKeyConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (564.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ForeignKey" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (575,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.ViewConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (590,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.TableTableConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (603,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ConstraintConstraintColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (616.4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ConstraintForeignKey" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (629.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.FromForeignKeyColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (642,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ToForeignKeyColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (655,4): error 0019: Each type name in a schema must be unique. The type name "MySqlClient.TableTableColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (668,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ViewViewColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (681,4): error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.FunctionFunctionParameter' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (694,4): Error 0019: Each type name in a schema must be unique. The type name "MySqlClient.ProcedureProcedureParameter" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (707,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.ViewViewConstraint' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (720.4): Error 0019: Each type name in a schema must be unique. The type name 'MySqlClient.ViewConstraintConstraintColumn' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (733,4): Error 0019: Each type name in the schema must be unique. The type name 'MySqlClient.ViewConstraintForeignKey' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (746,4): Error 0019: Each type name in the schema must be unique. The type name "MySqlClient.FromForeignKeyViewColumn" is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl (759,4): error 0019: Each type name in the schema must be unique. The type name "MySqlClient.ToForeignKeyViewColumn" is already defined. |

+2


source to share


4 answers


I'm still not sure about the specific reason, but it seems to fix the random failure:

Change

metadata=res://*;

      

The EDMX file namespace is currently running:



metadata=res://MyApplication.Entities;

      

The connection string to fix the problem looks like this:

<add name="v2Entities" connectionString="metadata=res://MyApplication.Entities;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;database=v2;uid=username;pwd=password&quot;" providerName="System.Data.EntityClient"/>

      

+3


source


Changing the connection string to include the project / EDMX namespace worked for me. But without ".Entities".



In my case, I had a solution with multiple projects, each with an EDMX file referring to a different MySQL database. Individually great, but running together while testing got the errors mentioned above.

+1


source


OK. I got this problem all of a sudden with MySql Connector 6.2.2 after months of using an entity with it without any issue.

I repeated the steps, I did 2 things, I don't know what messed it up, but it was one of them, then I'll tell you what I did in Web.config

order to fix it.

I have been playing around with the Ajax toolbox and another charting toolbox in the application I was working on.

  • While playing in my application, I tried to bind the diagram to an EntityDataSource using the generated wizard to create data sources from the design view.

  • I also made some data connections using basic ado.net connections with MySQL.Data namespace. My application contained solid typed datasets and entity structure.

It may have added an extra link to mysql / net apis. I have windows 7 and I was maintaining my application 4 days ago, so I rebuilt it and compared the two web config files. The difference was that the application that was giving me this error contained these additional assembly references at the end of the Assemblies section:

<add assembly="MySql.Data.Entity, Version=6.2.2.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />
    <add assembly="MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />

      

I removed them, everything you need from MySql:

<add assembly="MySql.Data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />

      

I hope this fixes the problem!

+1


source


For some users, please clear the bin folder and try again. For me, I was getting this error when deploying to a server 2003 site. I renamed the project and there was an old assembly (.dll) there. Since the connection string started with "res: // *; ...", it looked for ALL assemblies (even unloaded ones) for the resource and found duplicates (obviously).

0


source







All Articles