0

我正在使用 PushSharp 传递移动推送消息,它依赖于 Newtonsoft.Json.dll。我也通过 NuGet 安装了 Newtonsoft.Json.dll,因为我也将它用于其他事情。几天前,我通过 VS2012 中的 NuGet 将 Newtonsoft.Json.dll 更新为 v 6.x。当我在 VS2012 中运行项目时没有问题,但是当我部署到生产环境时,PushSharp 抛出一个异常,即找不到 Newtonsoft.Json.dll 4.5.x。根据 VS2012 中的 NuGet 管理器,PushSharp 的 Newtonsoft.Json.dll 要求是 ">= 4.5.x"。为什么它可以在我的开发机器上正常工作?我似乎在我的开发 PC 上的任何地方都找不到任何参考(GAC 或 bin)Newtonsoft.Json.dll 4.5。

4

1 回答 1

2

您可能需要将程序集绑定重定向添加到您的配置文件:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="1.0.0.0-4.5.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
于 2014-02-06T16:14:05.783 回答