![](/img/trans.png)
[英]Xamarin in Visual Studio cannot add xamarin.forms from Nuget
[英]Cannot add redux.NET to basic Xamarin.Forms project via nuget
Xamarin.forms 和 PCL 的新手,当我收到以下错误时,我正在尝试通过 nuget 添加https://github.com/GuillaumeSalles/redux.NET到 Hello world Xamarin.forms 项目:
Could not install package 'Redux.NET 1.0.1'. 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. For more information, contact the package author.
我需要定位什么框架 - 我应该尝试将 Xamarin.forms 入门项目更新到该框架吗? 是否有我可以查看的包配置文件以查看库所依赖的 .net 版本?
我在 .nuspec 文件中看到的唯一依赖项是我已经添加的 System.Reactive 3.0.0。
这是我尝试添加 redux 之前的 packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Xamarin.Forms" version="2.3.1.114" targetFramework="portable45-net45+win8+wp8+wpa81" />
</packages>
Redux.NET 1.0.1 在其 NuGet 包中有一个可移植的类库程序集文件夹:
portable-net45+netcore45
这映射到 PCL 配置文件 7。
如果您更改项目以使用该配置文件,那么 Redux.NET 将安装到其中而不会出现任何错误。
为了解决这个问题,我查看了 NuGet 包,它基本上是一个具有不同扩展名的 .zip 文件,然后使用Stephen Cleary 的便携式库配置文件站点来查看哪个配置文件与该配置文件完全匹配或最接近该配置文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.