我正在创建要在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.
如何创建PCL库并添加Async / Await支持而不欺骗* .csproj文件(我知道我可以在那里指定配置文件,但我需要能够通过UI进行DEMO目的)。
答案 0 :(得分:2)
您的项目的目标是Windows Phone 7.0,而不是7.1 / 7.5。将目标更改为“Windows Phone 7.5及更高版本”。
为获得最佳效果,请卸载所有NuGet包,更改目标,然后重新安装NuGet包。