MySql和Entity框架随机给出Schema指定的无效错误

发布于 2024-08-03 16:23:00 字数 9434 浏览 7 评论 0原文

我正在使用实体框架访问我​​的 MySQL 数据库。该模型是使用 EDMGEN2 生成的,一切运行良好。我可以完成所有 linq-to-entity 查询的任务...

...直到不确定的时间过去,我收到“ProviderManifestToken '5' 与之前遇到的 '5.1' 不同”错误。当我只指定“5.1”时,为什么它一开始就遇到“5”?!!?

停止错误的唯一方法是重新上传到 edmx 文件(根本没有更改),覆盖前一个文件。那时,应用程序将愉快地向用户提供数据,直到BAM错误发生,可能是几个小时后,有时是几天后,我将不得不再次开始追赶我的尾巴。

我尝试将 ProviderManifestToken="5.1" 更改为“MySQL”、“6”、“5”,并且会发生相同的情况:工作一段时间然后出现错误。作为奖励,我在 vb.net webforms 应用程序中只有一个 edmx 文件,那么它会被什么迷惑呢?

我的 edmx 文件的前几行看起来像:

<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">.....

我的 web.config 中的连接字符串看起来像:

<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" />

这已经持续了上个月了,我一生都无法找出问题的根源!如有任何建议,我们将不胜感激

设置如下:

Windows Server 2003 MySQL v 5.1.38(也在 5.1.36 上尝试过) Connector/NET 6.1.1.0(也在6.0.4.0上尝试过)

错误如下:

指定的架构无效。错误: MySql.Data.Entity.Properties.SchemaDefinition-5.1.ssdl(4,9):错误 0169:所有 SSDL 工件必须针对同一提供程序。 ProviderManifestToken“5”与之前遇到的“5.1”不同。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(4,9):错误 0169:所有 SSDL 工件必须针对同一提供程序。 ProviderManifestToken“5”与之前遇到的“5.1”不同。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(7,4):错误 0019:EntityContainer 名称必须是唯一的。名称为“Schema”的 EntityContainer 已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(336,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Table”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(348,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.TableColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(374,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.View”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(386,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(412,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Function”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(437,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Procedure”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(447,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Parameter”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(471,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Constraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(483,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.CheckConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(491,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ConstraintColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(500,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ForeignKeyConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(509,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ForeignKey”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(520,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(535,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.TableTableConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(548,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ConstraintConstraintColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(561,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ConstraintForeignKey”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(574,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.FromForeignKeyColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(587,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ToForeignKeyColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(600,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.TableTableColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(613,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(626,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.FunctionFunctionParameter”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(639,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ProcedureProcedureParameter”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(652,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewViewConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(665,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewConstraintConstraintColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(678,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewConstraintForeignKey”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(691,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.FromForeignKeyViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-5.0.ssdl(704,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ToForeignKeyViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(4,9):错误 0169:所有 SSDL 工件必须针对同一提供程序。 ProviderManifestToken“5”与之前遇到的“5.1”不同。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(7,4):错误 0019:EntityContainer 名称必须是唯一的。名称为“Schema”的 EntityContainer 已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(391,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Table”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(403,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.TableColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(429,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.View”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(441,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(467,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Function”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(492,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Procedure”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(502,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Parameter”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(526,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.Constraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(538,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.CheckConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(546,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ConstraintColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(555,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ForeignKeyConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(564,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ForeignKey”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(575,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(590,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.TableTableConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(603,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ConstraintConstraintColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(616,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ConstraintForeignKey”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(629,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.FromForeignKeyColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(642,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ToForeignKeyColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(655,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.TableTableColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(668,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(681,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.FunctionFunctionParameter”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(694,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ProcedureProcedureParameter”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(707,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewViewConstraint”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(720,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewConstraintConstraintColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(733,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ViewConstraintForeignKey”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(746,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.FromForeignKeyViewColumn”已定义。

MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(759,4):错误0019:架构中的每个类型名称必须是唯一的。类型名称“MySqlClient.ToForeignKeyViewColumn”已定义。|

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">
<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:

<add name="v2Entities" connectionString="metadata=res://*;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;database=v2;uid=username;pwd=password"" 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.|

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

月棠 2024-08-10 16:23:00

我仍然不确定确切的原因,但以下似乎可以修复随机崩溃:

将 更改

metadata=res://*;

为 EDMX 文件的实际命名空间似乎有效:

metadata=res://MyApplication.Entities;

修复连接字符串的问题现在如下所示:

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

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="server=localhost;database=v2;uid=username;pwd=password"" providerName="System.Data.EntityClient"/>
冷默言语 2024-08-10 16:23:00

更改连接字符串以包含项目/EDMX 命名空间对我有用。但没有“.Entity”。

就我而言,我有一个包含多个项目的解决方案,每个项目都有一个 EDMX 文件引用不同的 MySQL 数据库。单独使用没问题,但是当一起运行测试时出现上述错误。

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.

爱殇璃 2024-08-10 16:23:00

好吧,伙计们,在使用实体框架几个月没有任何问题后,我突然在 MySql Connector 6.2.2 上遇到了这个问题。

我回顾了我的步骤,我做了两件事,我不知道是什么搞砸了,但它是其中之一,然后我会告诉你我在 Web.config 中做了什么来修复它。

我正在使用 Ajax 工具包和我一直在开发的应用程序中的另一个图表工具包。

  1. 在我的应用程序中,我尝试使用设计视图中的创建新数据源向导将图表数据绑定到 EntityDataSource。

  2. 我还使用基本的 ado.net 连接与 MySQL.Data 命名空间进行了一些数据连接。我的应用程序始终是固定类型的数据集和实体框架。

它可能添加了对执行此操作的 MySql 连接器/网络 api 的附加引用。我有 Windows 7,它在 4 天前备份了我的应用程序,所以我恢复了它并比较了 2 个 Web 配置文件。不同之处在于,给我这个错误的应用程序在程序集部分的末尾有这些额外的程序集引用:

<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" />

我删除了这些,您在 MySql 中需要的只是:

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

我希望这能解决某人的问题!

OK folks I had this problem suddenly with MySql Connector 6.2.2 after months of using entity framework with it without any 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!

迟月 2024-08-10 16:23:00

对于某些人,请清除 bin 文件夹并重试。对于我来说,在部署到 server 2003 站点时遇到此错误。我重命名了一个项目,旧的程序集 (.dll) 就在那里。由于连接字符串以“res://*;...”开头,因此它在所有程序集(甚至未加载的程序集)中搜索资源并发现重复项(显然)。

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

烦人精 2024-08-10 16:23:00

我像这样更改了 web.config 文件并且它起作用了

 <add name="myConnection" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;port=3306;userid=root;password=;database=testdb;persistsecurityinfo=True" />

I changed the web.config file like this and it worked

 <add name="myConnection" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;port=3306;userid=root;password=;database=testdb;persistsecurityinfo=True" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文