1

我有问题标题中描述的问题。

我不明白究竟是什么原因 Nuget 无法在 Visual Studio 2012 Express(在 Windows 8 Pro x64 上)中将 MySQL.Data 框架库添加到我的项目(Silverlight v4.0 / C# 目标 Windows Phone 7.1) . 我还尝试手动添加通过 MySQL 官方站点(6.5 和更高版本)下载它们的 .dll 文件,但未成功。

它表示该包不包含对与 (MySQL.Data) 框架兼容的程序集或数据文件的一些引用。

任何想法如何解决这个问题?

PS:当我尝试安装 Nuget.Core 包时,它给了我同样的错误,我不知道这是否是 Nuget 管理器损坏的症状......

4

1 回答 1

1

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.

于 2013-05-20T11:39:21.877 回答