0

I am using PushSharp to deliver mobile push messages, it is dependent on Newtonsoft.Json.dll. I have installed Newtonsoft.Json.dll through NuGet as well because I use it for other things too. A few days ago I updated the Newtonsoft.Json.dll to v 6.x through NuGet in VS2012. When I run the project in VS2012 there are no problems, however when I deploy to production, PushSharp throws an exception that Newtonsoft.Json.dll 4.5.x cannot be found. The Newtonsoft.Json.dll requirements for PushSharp according to NuGet Manager in VS2012 is ">= 4.5.x". Why would it work on my development machine without issue? I cant seem to find any reference (GAC or bin) Newtonsoft.Json.dll 4.5 anywhere on my dev PC.

Mike_G
  • 16,237
  • 14
  • 70
  • 101

1 Answers1

2

You might need to add an assembly binding redirect to your configuration file:

<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>
Brian Rogers
  • 125,747
  • 31
  • 299
  • 300
  • thank you. The NuGet/VS update incorrectly updated that section of my config and I completely missed it. – Mike_G Feb 06 '14 at 18:35