2016-10-02 66 views
1

Xamarin.forms和PCLs的新手,我试图通过nuget将https://github.com/GuillaumeSalles/redux.NET添加到Hello world Xamarin.forms项目中,当我收到以下错误:无法通过nuget添加redux.NET到基本的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 starter项目更新到该框架吗?有没有一个软件包配置文件,我可以看看这个库依赖于什么.net版本?

我在.nuspec文件中看到的唯一依赖项就是我已经添加的System.Reactive 3.0.0。

这里是我的packages.config之前,我尝试添加Redux的

<?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> 

回答

1

Redux.NET 1.0.1有一个便携式类库组件文件夹中的NuGet包:

portable-net45+netcore45 

这映射到PCL配置文件7.

如果您将项目更改为使用该配置文件,则Redux.NET将无任何错误地安装到该配置文件中。

为了解决这个问题,我看了一下NuGet包,它基本上是一个带有不同扩展名的.zip文件,然后使用Stephen Cleary's portable library profiles site来查看哪个配置文件是完全匹配或最接近该配置文件。

+0

当我切换到配置文件7时,出现错误,指出Reactive包和Xamarin.Forms现在不兼容。我应该问Redux.NET所有者更新他的软件包吗? – MonkeyBonkey

+0

Reactive和Xamarin.Forms NuGet软件包(包括最新版本和您使用的版本)都可以很好地安装到一个新的PCL项目中,该项目的目标是配置文件7.这已经通过Xamarin Studio 6.1进行了测试。 –

+0

好的,我删除了现有的xamarin.forms和反应包并重新添加,现在它可以正常工作。 – MonkeyBonkey

相关问题