2016-03-14 114 views
1

我的朋友給了我一個在Xamarin Studio中創建的項目。當我嘗試運行項目時,我收到了與衝突程序集引用有關的警告。更改衝突的裝配參考

我用AsmSpy工具來檢查哪些引用是相互矛盾的,我得到了以下的輸出:

Detailing only conflicting assembly references. 
Reference: Newtonsoft.Json 
    6.0.0.0 by Akavache  <-- this one is Green 
    6.0.0.0 by Akavache.Sqlite3  <-- this one is Green 
    8.0.0.0 by MyAppName  <-- this one is Red 

Reference: Splat 
    1.6.0.0 by Akavache 
    1.6.0.0 by Akavache.Sqlite3 
    1.6.2.0 by MyAppName 

我從來沒有與Xamarin工作室工作,我缺乏這方面的話題有一定的瞭解。如何更改引用來停止此警告?

回答

2

您應該可以使用程序集重定向來'碰撞'所有程序集以使用特定版本。

(你將需要更新名稱,公鑰和相應的版本)

<dependentAssembly> 
     <assemblyIdentity name="Akavache" publicKeyToken="1234567890" culture="neutral" /> 
     <bindingRedirect oldVersion="1.0.0.0-8.0.0.0" newVersion="8.0.0.0" /> 
     </dependentAssembly> 

這些都需要在運行時節點的* config文件;

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">