在搞在線(xiàn)聊天室的時(shí)候用到了SignalR 1.1.4,依賴(lài)于Newtonsoft.Json 4.5.0.0。
而我另外的dll又依賴(lài)Newtonsoft.Json 6.0.0.0
我只引用6.0.0.0的時(shí)候提示找不到4.5.0.0的dll,
搜了一下用bindingredirect ,但是搞半天還是報(bào)同樣的錯(cuò)誤,后面發(fā)現(xiàn)是配置寫(xiě)錯(cuò)了。
錯(cuò)誤的配置:
<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>
萬(wàn)能的vs編譯器木有告訴我,我哪里寫(xiě)錯(cuò)了。
搜這里知道的:http://stackoverflow.com/questions/3490327/assembly-binding-redirect-does-not-work
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注