bindingredirect 沒有效果


在搞在線聊天室的時候用到了SignalR 1.1.4,依賴於Newtonsoft.Json 4.5.0.0。

而我另外的dll又依賴Newtonsoft.Json 6.0.0.0

我只引用6.0.0.0的時候提示找不到4.5.0.0的dll,

搜了一下用bindingredirect ,但是搞半天還是報同樣的錯誤,后面發現是配置寫錯了。

錯誤的配置:

      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" PublicKeyToken="30ad4fe6b2a6aeed"  culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>

正確的配置:

      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"  culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>

 

萬能的vs編譯器木有告訴我,我哪里寫錯了。

搜這里知道的:http://stackoverflow.com/questions/3490327/assembly-binding-redirect-does-not-work

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM