System.IO,FileLoadException Error when application runs

I am having a very odd issue. I have done some research online in regards to this but none of the answers seem to help. This application was compiling and running properly a couple days ago, now it just errors out with the following error. Any suggestions on what I can do to resolve the issue? I really don't know where to go from here.

System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=xxxxx' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=xxxxx'

Upvotes: 1

Views: 1536

Answers (1)

theMayer
theMayer

Reputation: 16157

My next steps would be to do the following:

  1. Remove this in all projects using NuGet.
  2. Go into the NuGet package repository and delete the files for Newtonsoft.Json. (they shouldn't still be there but if they are, it indicates a problem with NuGet and more troubleshooting there is required - in my experience, NuGet works about 30% of the time, and the rest of the time it is a pain in the ass).
  3. Manually delete all the bin and obj folders in your project(s).
  4. Re-add the Json library via NuGet.

If that doesn't work, please tell that as well.

Upvotes: 1

Related Questions