2013-07-06 27 views
1

我有一个使用Microsoft.Bcl.Async Nuget包的PCL项目,它具有一些通用代码。现在,当我引用的程序集,并使用一些异步方法在我的WP8项目中,我得到以下错误:异步PCL assmeblies不匹配

Cannot convert source type 'System.Threading.Tasks.Task<byte[]> [System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]' to target type 'System.Threading.Tasks.Task<byte[]> [mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]' 

我曾尝试加入以下组件结合,并且还加入了Microsoft.Bcl.Async的NuGet包我的WP8项目,但似乎没有任何工作。

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

有没有人有任何想法我做错了什么,或者我可以尝试什么?

非常感谢

回答

0

可以尝试:

  1. 卸载包到处
  2. 删除引用System.Runtime,System.Threading.Tasks或Microsoft.Threading任何绑定重定向*。来自所有项目。
  3. 重新安装程序包中的每个项目包括WP8项目

应该有在WP8项目指的是系统没有约束力的重定向。* - 如果有,删除它们也(你可能会击中https://nuget.codeplex.com/workitem/3072)。