2016-10-02 74 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

相關問題