RavenDB and SignalR Nuget Package Dependency Conflict

天涯浪子 提交于 2019-12-05 02:30:18

We were running into the same issue a few days ago and this is a nasty one. We found that you can't keep the dependencies managed with NuGet. Instead, we have changed SignalR to use 4.0.5 and compiled it locally.

There is even a more appropriate way to work around this conflict. Since .NET gives us the possiblity to redirect assemblies, why not use it ;)

You can just add something like that to your App.config (take care if there is already an assemblyBinding placed):

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
         <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.5.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

With this redirect set you can simply add the RavenDB package and the SignalR package (each of them referring to an other version of JSON.NET) and it does the fix.

Additionally i did an pull request on SignalR to request support for JSON.NET in version 4.0.5 too (since it should be backward compatible)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!