7

My code throws this runtime exception

{"Could not load file or assembly 'Newtonsoft.Json.Net35, Version=4.0.2.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.":"Newtonsoft.Json.Net35, Version=4.0.2.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"}

But I have installed Newtonsoft.Json using NuGet

How can I fix this?

4
  • Which version of the Newtonsoft.Json library do you have installed?
    – Uwe Keim
    Mar 14, 2013 at 14:44
  • 2
    try to add it in references then restart VS and run again. Mar 14, 2013 at 14:45
  • @UweKeim Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
    – Elad Benda
    Mar 14, 2013 at 15:48
  • So this answers your own question, right? 4.5.0.0 seems to be different than 4.0.2.0, isn't it?
    – Uwe Keim
    Mar 14, 2013 at 16:26

1 Answer 1

8

A few options:

  • Make sure nuget updated your packages.config file and packagerestore is turned on. These can cause issues when using a VCS and a user doesn't properly commit changes back.
  • Try restarting VS, I have found that after pulling down from a VCS, the references don't always update properly
  • Open nuget, remove the package and reinstall it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.