2016-10-17 78 views
1

我尝试使用通用Windows平台创建项目。我做了其中的一些,但下载.NET Core后,我遇到了NuGet软件包的问题。当我尝试安装MySql.Data我得到.NETcore,UWP - 无法安装NuGet包

包恢复失败。

输出:

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": {} 
    } 
} 
+1

当您尝试加载Nuget时,您是否可以使用'nuget'软件包的链接更新您试图安装的软件包以及'Package Manager Console'的输出? – AVK

回答

2

问题是由一个事实,即MySql.Data是不兼容UWP造成的。当你看到软件包管理器输出,这是明确提出:

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应用商店的认证,但我没有尝试过。

似乎可以将旧版本的MySql.Data(6.9.7)安装到UWP项目中,但以后无法将该应用发布到Store - 请参阅example here

BouncyCastle的问题非常类似,便携版本与UWP兼容。