开发者

Silverlight deployment data provider missing

I am deploying a silverlight application which uses a mysql db through ADO.NET Entity Data Model.

When trying to run the application from my host, the WCF service works fine, but I get a server exception when calling from wcf service:

Unable to find the requested .Net Framework Data Provider. It may not be installed. at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)

at System.Data.EntityClient.EntityConnection.GetFactory(String providerString).

My code in web.config is defined as follows

  <connectionStrings>
<add name="modelEntities"  
providerName="System.Data.EntityClient"
connectionString="metadata=res://*;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;User Id=userid;password=mypass;database=mydb;&quot;"/>
 </connectionStrings>

On my local project it works fine, as I have installed the .NET Connector for mysql, etc. The host supports .net 3.5 linq and mysql. What do I need to do to fix this?


I have tried adding

<system.data>
<DbProviderFactories>
<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.2.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

and MySql.Data.dll and MySql.Data.Entity.dll in the bin folder and now i am getting the error:

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.Pr开发者_C百科operties.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.

What's this? Why is it so hard to deploy this?


I would try adding an explicit reference to MySql.Data, then on your hosting account ensure the a copy of MySql.Data.dll is included in your bin folder.


As far as I remember. You cannot have two entity models using different databases in the same project. It seems like you also have a sql server or other db entity model or something referring to sql server which isnt clean.

Try with only one entity model with mysql only.


Did you point the Entity framework to some db first and then shifted to mysql?

Seems like somebody has similar problem

click here to see the error & solution that worked for him

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜