【问题标题】:.NETcore, UWP - can't install NuGet package.NETcore、UWP - 无法安装 NuGet 包
【发布时间】:2016-10-18 15:39:26
【问题描述】:

我尝试使用通用 Windows 平台创建项目。我做了其中的一些,但是在下载 .NET Core 之后,我遇到了 NuGet 包的问题。当我尝试安装 MySql.Data 我得到 ​​p>

包还原失败。

输出:

MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0.
Some packages are not compatible with UAP,Version=v10.0.
MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0 (win10-arm).
Some packages are not compatible with UAP,Version=v10.0 (win10-arm).
MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0 (win10-arm-aot).
Some packages are not compatible with UAP,Version=v10.0 (win10-arm-aot).
MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0 (win10-x64).
Some packages are not compatible with UAP,Version=v10.0 (win10-x64).
MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0 (win10-x64-aot).
Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot).
MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0 (win10-x86).
Some packages are not compatible with UAP,Version=v10.0 (win10-x86).
MySql.Data 6.9.9 is not compatible with UAP,Version=v10.0 (win10-x86-aot)

我读到我应该将 .NET 核心更新到 5.2.2 版,但它不起作用。我不知道我该怎么做。我对 BouncyCastle 包也有问题,但我找到了 Portable-BouncyCastle 版本。

这是我的 project.json

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2",
    "Portable.BouncyCastle-Signed": "1.7.0.2"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

【问题讨论】:

  • 当您尝试加载 Nuget 时,您能否使用您尝试安装的 nuget 包的链接和从 Package Manager Console 输出的链接更新您的问题?

标签: uwp nuget-package windows-10-universal .net-core


【解决方案1】:

问题是由MySql.Data 与UWP 不兼容引起的。当您看到 Package Manager 输出时,会清楚地说明这一点:

Package MySql.Data 6.9.9 is not compatible with uap10.0 (UAP,Version=v10.0).
Package MySql.Data 6.9.9 supports:
  - net40 (.NETFramework,Version=v4.0)
  - net45 (.NETFramework,Version=v4.5)

我找到了一个repo on GitHub,它显然是试图从MySql.Data 包中获取兼容的API,以便应用程序可以通过Windows Store 认证,但我没有尝试过。

然而,似乎可以将旧版本的 MySql.Data (6.9.7) 安装到 UWP 项目中,尽管以后无法将应用程序发布到应用商店 - 请参阅 example here

BouncyCastle的问题很类似,便携版兼容UWP。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-15
    • 2014-02-15
    • 1970-01-01
    • 2016-12-28
    • 2018-08-29
    • 1970-01-01
    相关资源
    最近更新 更多