c# - PCL 可移植 - NuGet 不支持

标签 c# xamarin.ios nuget portable-class-library xamarin-studio

我已经创建了一个 PCL 项目,每当我尝试从 Nuget 添加引用时,我都会遇到这个错误:(这个错误发生在所有包中)

Could not install package 'Microsoft.Bcl.Build 1.0.13'. You are trying to install this package into a project that targets 'portable-Unsupported', 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. System.InvalidOperationException: Could not install package 'Microsoft.Bcl.Build 1.0.13'. You are trying to install this package into a project that targets 'portable-Unsupported', 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. at NuGet.ProjectManager.ExtractPackageFilesToProject (IPackage package) [0x00000] in :0 at NuGet.ProjectManager.AddPackageReferenceToProject (IPackage package) [0x00000] in :0 at NuGet.ProjectManager.Execute (NuGet.PackageOperation operation) [0x00000] in :0
at NuGet.ProjectManager.Execute (IPackage package, IPackageOperationResolver resolver) [0x00000] in :0 at NuGet.ProjectManager.AddPackageReference (IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) [0x00000] in :0 at NuGet.ProjectManager.AddPackageReference (System.String packageId, NuGet.SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) [0x00000] in :0 at ICSharpCode.PackageManagement.SharpDevelopPackageManager.AddPackageReference (IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) [0x00000] in :0 at ICSharpCode.PackageManagement.SharpDevelopPackageManager.InstallPackage (IPackage package, ICSharpCode.PackageManagement.InstallPackageAction installAction) [0x00000] in :0 at ICSharpCode.PackageManagement.PackageManagementProject.InstallPackage (IPackage package, ICSharpCode.PackageManagement.InstallPackageAction installAction) [0x00000] in :0 at ICSharpCode.PackageManagement.InstallPackageAction.ExecuteCore () [0x00000] in :0 at ICSharpCode.PackageManagement.ProcessPackageAction.Execute () [0x00000] in :0 at ICSharpCode.PackageManagement.PackageActionRunner.Run (IPackageAction action) [0x00000] in :0 at ICSharpCode.PackageManagement.PackageViewModel.InstallPackage (IEnumerable`1 packageOperations) [0x00000] in :0
at ICSharpCode.PackageManagement.PackageViewModel.InstallPackage () [0x00000] in :0 at ICSharpCode.PackageManagement.PackageViewModel.TryInstallingPackage ()

[0x00000] in :0

那是关于我的环境的信息

=== Xamarin Studio ===

Version 4.2.2 (build 2)
Runtime:
    Mono 3.2.5 ((no/964e8f0)
    GTK+ 2.24.20 theme: Raleigh
    GTK# (2.12.0.0)
    Package version: 302050000

=== Xamarin.Android ===

Version: 4.10.1 (Business Edition)
Android SDK: /Users/luigisaggese/Library/Developer/Xamarin/android-sdk-mac_x86
    Supported Android versions:
        1.6   (API level 4)
        2.1   (API level 7)
        2.2   (API level 8)
        2.3   (API level 10)
        3.1   (API level 12)
        3.2   (API level 13)
        4.0   (API level 14)
        4.0.3 (API level 15)
        4.1   (API level 16)
        4.2   (API level 17)
Java SDK: /usr
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

=== Apple Developer Tools ===

Xcode 5.0.2 (3335.32)

=== Xamarin.iOS ===

Version: 7.0.5.2 (Business Edition)
Build date: 2013-02-12 20:04:08-0500

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Operating System ===

Mac OS X 10.8.5

最佳答案

NuGet v2.7.2 支持 Xamarin 的可移植类库.

我相信 Matt Ward 的 Xamarin Studio 插件的 0.8 版是基于 NuGet v2.7.2 的。

可在此处找到安装说明:https://github.com/mrward/monodevelop-nuget-addin#installation

关于c# - PCL 可移植 - NuGet 不支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21259936/

相关文章:

c# wp7 可检查列表

c# - 在 Xamarin.iOS (Xamarin Monotouch) 中绘制圆圈以图形方式显示进度

c# - 队列排序

C#:如何将内部 .html 文件资源加载到 Web 浏览器控件中?

iphone - 如何在 MonoTouch 中注册 UIApplicationWillEnterForegroundNotification

iphone - MVC 如何正确获取自定义单元格中控件的值?

nuget - 将包管理默认为 PackageReference

macos - 是否可以找出我在 Mac OSX 上安装的 Nuget 版本?

.net - 如何确保我维护的库/包向后兼容?

c# - 实时观察 WPF 中写入的 CSV