SignalR & WebApi - colliding Newtonsoft.Json references

前端 未结 1 668
一向
一向 2021-01-17 12:38

I have a windows client that connects to a SignalR 2.0 back-end, now I am trying to make it connect to a ASP.NET Web API 2.1 back-end as well.

The library that I use

相关标签:
1条回答
  • 2021-01-17 13:05

    Web API & SignalR were built with reference to 4.5 assembly version of Json.net..if you would like to use 6.0 version of Json.net, you would need to add an assembly binding redirect in your configuration file.

    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <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>
    
    0 讨论(0)
提交回复
热议问题