C# Xamarin.iOS类库引用Nito.AsyncEx NuGet包时发生编译错误

C# Xamarin.iOS类库引用Nito.AsyncEx NuGet包时发生编译错误,c#,xamarin,async-await,C#,Xamarin,Async Await,我正在尝试创建一个特定于iOS的类库程序集,它使用优秀的。当我引入包时,编译器会标记与同一依赖程序集的不同版本的冲突: 1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that

我正在尝试创建一个特定于iOS的类库程序集,它使用优秀的。当我引入包时,编译器会标记与同一依赖程序集的不同版本的冲突:

1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
1>c:\Users\mpilot\Documents\Visual Studio 2013\Projects\IosTestClassLib\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+win8\System.IO.dll : error CS1703: An assembly with the same identity 'System.IO, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.
1>c:\Users\mpilot\Documents\Visual Studio 2013\Projects\IosTestClassLib\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+win8\System.Runtime.dll : error CS1703: An assembly with the same identity 'System.Runtime, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.
1>c:\Users\mpilot\Documents\Visual Studio 2013\Projects\IosTestClassLib\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+win8\System.Threading.Tasks.dll : error CS1703: An assembly with the same identity 'System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.
看起来Nito.AsyncEx包导入了Microsoft.Bcl包,这可能与Xamarin.iOS中的mono实现冲突

查看.nuspec文件,我看到MonoTouch相关的目标框架都将Microsoft.Bcl列为依赖项。这同样适用于.Net Framework 4.0目标。对于以.NET4.5为目标的项目,Microsoft.Bcl当然不作为依赖项列出

顺便说一句,Xamarin最新的iOS SDK实现了.NET4.5中的所有异步等待功能。这意味着Nito.AsyncEx NuGet包应该将自己添加到以Xamarin.iOS为目标的类库中,就像类库以.Net 4.5为目标一样

事实上,如果我从程序集引用和Microsoft.Bcl引用中删除Nuget包,然后从Nuget的net45子文件夹中手动添加Nito.AsyncEx DLL,一切正常-项目链接和Nito.AsyncEx功能按预期工作-至少是我使用的部分

我知道这是一个黑客行为,我不想在生产代码中这样做,但它告诉我,我对这个问题的初步分析并不是完全错误的


我错过什么了吗?我是否需要调整项目设置,以便将适当的包目标部署到我的类库中?或者NuGet软件包有什么问题吗?

事实证明,该问题已在Microsoft.Bcl 1.1.10版中修复。简单地从1.1.8更新到1.1.10就成功了