首页 > 代码库 > bindingredirect 没有效果
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
bindingredirect 没有效果
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。