Luca Montanari
Luca Montanari

Reputation: 123

VS 2012 - Can't add MySQL.Data libraries to my WP7 C# project

I have the problem described in question title.

I doesn't understand for what exactly reason(s) Nuget can't add libraries of MySQL.Data framework to my project (Silverlight v4.0 / C# target Windows Phone 7.1) in Visual Studio 2012 Express (on Windows 8 Pro x64). I tried also to add manually the .dll files downloading them by official MySQL site (6.5 and newer versions), but unsuccessfully.

It says that the package doesn't contain some references to assemblies or data files compatible with the (MySQL.Data) framework.

Any ideas how to risolve this problem?

P.S.: it give me the same error when I try to install Nuget.Core package, I don't know if it's a symptom of a corrupt Nuget manager...

Upvotes: 1

Views: 461

Answers (1)

jessehouwing
jessehouwing

Reputation: 114631

The MySQL.Data package depends on the System.Data library to create a connection directly to your database. Direct database connections are not supported by the Windows Phone libraries, since it would require your phone to connect to your databases and establish a stateful connection. These types of connections are brittle and costly to maintain.

When you browse your packages\**library**\Lib folder you'll see a binary for each supported platform. For example the HTMLAgilityPack includes a sl4-windowsphone71, and is thus supported. The MySQL.Data does not, and as such is not supported: Difference between support of framework versions

Instead you'll need to expose a webservice (XML or JSON for example) which can be consumed by your Windows Phone app in a stateless fashion.

Upvotes: 1

Related Questions