![](/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.