views:

1066

answers:

4

I'm using Entity Framework to access my MySQL database. The model was generated using EDMGEN2 and everything works great. I can do all my linq-to-entity query goodness...

...until an indeterminate amount of time passes and I get "The ProviderManifestToken '5' is different from '5.1' that was encountered earlier" error. Why is it encountering a '5' to begin with when I've only specified '5.1'?!!?

The only way to get the error to stop is to reupload to edmx file (which has not changed at all), overwriting the previous one. At that point the application will happily chug along serving data to users until BAM the error occurs maybe a few hours later, sometimes days later and I'll have to start chasing my tail again.

I've tried changing the ProviderManifestToken="5.1" to "MySQL", "6", "5" and the same situation will occur: works for a while then the error. As a bonus I only have this ONE edmx file in the vb.net webforms application so what is it getting confused by?

the first few lines of my edmx file looks like:

<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"&gt;
<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"&gt;
  <EntityContainer Name="v2ModelStoreContainer">.....

and my connection string in web.config looks like:

<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 going on for the last month now and I cannot figure out the source of the problem for the life of me! Any suggestions at all will be appreciated

Setup is as follows:

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

The error is as follows:

Schema specified is not valid. Errors: MySql.Data.Entity.Properties.SchemaDefinition-5.1.ssdl(4,9) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '5' is different from '5.1' that was encountered earlier.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(4,9) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '5' is different from '5.1' that was encountered earlier.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(7,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name '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. Type name 'MySqlClient.Table' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(348,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.TableColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(374,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.View' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(386,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewColumn' was already defined.

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

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(437,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Procedure' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(447,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Parameter' was already defined.

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

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(483,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.CheckConstraint' was already defined.

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

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

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(509,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ForeignKey' was already defined.

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

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

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(548,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ConstraintConstraintColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(561,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ConstraintForeignKey' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(574,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.FromForeignKeyColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(587,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ToForeignKeyColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(600,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.TableTableColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(613,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewViewColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(626,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.FunctionFunctionParameter' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(639,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ProcedureProcedureParameter' was already defined.

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

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(665,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewConstraintConstraintColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(678,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewConstraintForeignKey' was already defined.

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

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

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(4,9) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '5' is different from '5.1' that was encountered earlier.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(7,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name 'Schema' is already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(391,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Table' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(403,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.TableColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(429,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.View' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(441,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(467,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Function' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(492,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Procedure' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(502,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Parameter' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(526,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.Constraint' was already defined.

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

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(546,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ConstraintColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(555,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ForeignKeyConstraint' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(564,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ForeignKey' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(575,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewConstraint' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(590,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.TableTableConstraint' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(603,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ConstraintConstraintColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(616,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ConstraintForeignKey' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(629,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.FromForeignKeyColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(642,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ToForeignKeyColumn' was already defined.

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

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(668,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewViewColumn' was already defined.

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

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(694,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ProcedureProcedureParameter' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(707,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewViewConstraint' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(720,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewConstraintConstraintColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(733,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ViewConstraintForeignKey' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(746,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.FromForeignKeyViewColumn' was already defined.

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(759,4) : error 0019: Each type name in a schema must be unique. Type name 'MySqlClient.ToForeignKeyViewColumn' was already defined.|

+1  A: 

I'm still not sure of the exact cause but the following seems to fix the random crashing:

Changing the

metadata=res://*;

To the actual namespace of the EDMX file seems to work:

metadata=res://MyApplication.Entities;

The problem fixing connection string looks like the following now:

<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"/>
InnerSphere
I'm having similar issues. Can you tell my what's `MyApplication.Entities` related to?
Robert Koritnik
A: 

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

In my case I had a solution with multiple projects, each with an EDMX file referring to a different MySQL database. Individually fine, but when run together when doing testing received the errors mentioned above.

Scott N.
A: 

I'm having the same problem, but I'm not sure what I am supposed to replace "MyApplication.Entities" with in my case. Can someone explain this a bit more? I've tried everything I can think of, but nothing works.

Thanks Kevin

Kevin Rose
MyApplication.Entities is the namespace of my EDMX model generated by the edmgen2 program
InnerSphere
A: 

OK folks I had this problem suddenly with mysql connector 6.2.2 after months of using entity framework with it with not problems.

I retraced my 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 to fix it.

I was playing with the Ajax tool kit and another charting toolkit within the app I've been working on.

1) While playing around in my app, I tried to databind a chart to an EntityDataSource using the create new Datasource wizard from the design view.

2) I also did some data connections using basic ado.net connections with the MySQL.Data Namespace. My app was solid typed datasets and entity framework throughout.

It may have added an additional reference to the MySql connector/net apis doing this. I have windows 7 and it backed up my app 4 days ago so I restored it and compared the 2 web config files. The difference was the app that was giving me this error had 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 those, all you need out of MySql is :

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

I hope this will fix someone's problem!

JoeC