c# - Xamarin : Can not resolve reference: `System.Threading.Tasks.Extensions` , 被 `MySqlConnector` 引用。

标签 c# visual-studio xamarin.android

我无法在 Visual Studio 2017 中构建我的 Xamarin Android 项目。

我一直收到这个错误:

Can not resolve reference: `System.Threading.Tasks.Extensions`, referenced by `MySqlConnector`. Please add a NuGet package or assembly reference for `System.Threading.Tasks.Extensions`, or remove the reference to `MySqlConnector`.

System.Threading.Tasks.Extensions 随 NuGet 一起安装。我需要 MySqlConnector。

我已经清理了解决方案,清理了所有 NuGet 文件,重新启动了 Visual Studio,重新启动了我的 PC,重新安装了 NuGet 包,重新安装了所有 NuGet 包,从 Debug 切换到 Release 并返回,更改了 C# 版本,确保所有文件权限都是正确处理所有 NuGet 文件,将 System.Threading.Tasks.Extensions 引用为 dll 等。

但错误就在那里。有什么问题吗?

最佳答案

我相信你正在使用 System.Threading.Tasks.Extensions 4.5.1 或 4.5.2 版本,你可以尝试卸载 4.5.1 或 4.5.2 并在你的 Xamarin 中安装 4.5.0 版本.安卓项目。

截至目前(2019 年 1 月 14 日),这是 Xamarin 在较新版本中解决此问题的根本原因之前的解决方法。

关于c# - Xamarin : Can not resolve reference: `System.Threading.Tasks.Extensions` , 被 `MySqlConnector` 引用。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52747838/

相关文章:

c# - 使用 MessageBox.Show() 阻止所有窗口

git - 如何从 Visual Studio 2015 中创建 Git 裸存储库?

c++ - 避免 Visual Studio 项目的过多配置

c# - 如何在应用程序需要访问互联网的情况下使用 C# 进行 Android 开发?

c# - 使用 C# 在数据网格中显示 xml

c# - 使用 C# 在 vi​​sio 中创建递归流程图

c# - LambdaExpression 如何在运行时通过动态解析为 Expression<Func<T, returnT>> ?

C++|在函数外声明类

c# - Xamarin 表格 : This functionality is not implemented in the portable version of this assembly

c# - OnStartCommand/OnCreate 未调用