未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0....MVC4中NuGet SingalR后出现这样的问题

错误
出现这样的问题是因为MCV4 默认Newtonsoft.Json 4.5 而SingalR是需要版本6.0
解决办法是在webconfig runtime 中加入下面代码

  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="6.0.0.0" />
    </dependentAssembly>
  </assemblyBinding>
posted @ 2016-05-04 10:34  野生中的码农  阅读(323)  评论(0编辑  收藏  举报