2013-07-06 31 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)。