English 中文(简体)
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.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.

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





相关问题
Silverlight Rich text box control

Our team decided that we need our own custom Rich text box control for Silverlight app we are developing. We looked at existing controls mentioned at A good rich text control for Silverlight but ...

Silverlight ImageBrush not rendering (with Bing Map Control)

I m trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can t seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather ...

Silverlight OpenFileDialog DoEvents equivalent

I m processing large files after they are selected by the user. My code looks like the following: if (FileDialog.ShowDialog() == true) { // process really big file } This freezes up the UI so ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Silverlight 3 - FindName returns null

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null. <Grid> <common:CommonGridEditPanel x:...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called dates which is populated by a WCF service. The property is an ...

热门标签