1

我正在创建用于 Windows Store 8.0 和 Windows Phone 7.5 客户端的 PCL 库。我创建了新的 PCL 项目并选择了以下内容: https ://dl.dropboxusercontent.com/u/19503836/pcl_profile4.png

选定的配置文件涵盖 .net 4.5 和 silverlight 4.0,因此它们是自动启用的。结果,我选择了 Profile4,但是当我尝试将 Async nuget 包添加到 PCL 项目时: http ://www.nuget.org/packages/Microsoft.Bcl.Async

I'm getting an error that this profile is not supported:
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.0.19)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.4)'.
'Microsoft.Bcl.Build 1.0.10' already installed.
'Microsoft.Bcl 1.0.19' already installed.
'Microsoft.Bcl.Async 1.0.16' already installed.
Adding 'Microsoft.Bcl.Build 1.0.10' to PortableClassLibrary1.
Could not install package 'Microsoft.Bcl.Build 1.0.10'. You are trying to install this package into a project that targets 'portable-win+net45+sl40+wp', 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.

如何在不欺骗 *.csproj 文件的情况下创建 PCL 库并添加 Async/Await 支持(我知道我可以在那里指定配置文件,但我需要能够通过 UI 进行演示)。

4

1 回答 1

2

您的项目针对的是 Windows Phone 7.0,而不是 7.1/7.5。将您的目标更改为“Windows Phone 7.5 及更高版本”。

为获得最佳结果,请卸载所有 NuGet 包,更改目标,然后重新安装 NuGet 包。

于 2013-11-05T20:39:15.393 回答