【问题标题】:Visual Studio fails to add a Profile151 PCL to Xamarin projectVisual Studio 无法将 Profile151 PCL 添加到 Xamarin 项目
【发布时间】:2016-08-02 16:06:49
【问题描述】:

我正在尝试将 Profile151 PCL nuget 包添加到 Visual Studio 2015(更新 3)中的 Xamarin iOS 和 Android 项目,它告诉我该包不兼容。该软件包具有库文件夹“portable-net451-win81-wpa81”(即 Profile151 PCL 的 "official" recommendation

这是错误信息:"Could not install package 'velox.core 1.0.2.8'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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 Studio 将相同的 nuget 包添加到项目中。

这是什么原因?有解决办法吗?

【问题讨论】:

  • 为了明确您的问题,您要将 Profile151 PCL NuGet 包添加到实际 PCL 或 Xamarin.iOS/Xamarin.Android 项目中吗?您能否包括一步一步的复制以供进一步调查? (或示例项目以及您尝试添加的 NuGet 包)。
  • 我看到的问题是这里没有Xamarin.iOS10目标。唯一的目标是portable-net451-win81-wpa81。这意味着它将在带有这些项目的 PCL 中工作,但不适用于 Xamarin.iOS 项目。错误也提到了这一点:Could not install package 'velox.core 1.0.2.8'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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. 看到它确实在 XS 中工作是另一回事。
  • 这没有意义。带有“portable-net45+netcore45+wpa81+wp8”的包确实可以正常工作,而且该包也没有 Xamarin.iOS10 目标。
  • 看起来这是一个失败,配置文件未在 NuGet 客户端的硬编码列表中列出:github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/… 因此它在 VS 上失败但在 XS 上失败,因为 XS 通过 @ 中的单声道兼容987654328@/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/xbuild-frameworks/.NETPortable/v4.6/Profile/Profile151/SupportedFrameworks 中的文件在我们发言时,我正在报告 NuGet 端的错误,并将跟进 SO 上的答复以进行跟踪。

标签: visual-studio xamarin nuget portable-class-library


【解决方案1】:

对于 VS 2015,这似乎是 NuGet 客户端方面的故障。理想情况下,Profile151 应标记为与Xamarin.iOS 兼容,但事实并非如此。这是因为 NuGet v3 中的硬编码列表没有列出 Profile151

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Frameworks/DefaultPortableFrameworkMappings.cs#L112

因此我在NuGet.Client github 上报告了一个问题:

https://github.com/NuGet/Home/issues/3268

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-26
    相关资源
    最近更新 更多