更改 Xamarin.Forms .Net Framework 目标

Nic*_*iff 2 c# xamarin xamarin.forms

我有一个 Xamarin Forms 项目,大多数时候我想安装一个 nuget 包,我有一个错误说:

Install-Package : Could not install package 'Microcharts 0.7.1-pre'. You are trying to install this package into a project that targets 
'.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework.
Run Code Online (Sandbox Code Playgroud)

我假设我可以通过更改项目 .net 框架目标来解决这个问题。但是当我去更改它时,我收到一条错误消息,说它无法更改目标,因为这意味着将 nuget 升级到 3.0 而它不能这样做。

所以我的问题是:哪个是更改目标框架的最佳方式(也是最简单的),所以我在使用 nuget 包时遇到的问题较少。

Han*_*ant 5

这个库是为 .NETStandard v1.4 构建的。您试图在 PCL 项目中使用它,这是不可能的。PCL 正在淘汰,因为以前构建跨平台库的方法不太好,而 .NETStandard 是新方法。

这个库没有旧版本可用,从源代码重建它是一个可能的选择。但实际上是时候继续前进以避免一遍又一遍地撞墙了,您需要更新您的工具,以便您可以使用这些类型的库。VS2017 社区版是免费软件。