0

My code is giving me the following error:

Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=token' or one of its dependencies. The system cannot find the file specified.

The project had v 7.0.1 installed. The app.config has a bindingRedirect:

oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0"

I tried to update that to point to 7.0.1 and that didn't work.

I have tried to remove and replace the reference to the dll in the project, but to no result. I've done a package restore. Can anyone tell me what I'm missing?

will
  • 837
  • 3
  • 11
  • 24
  • http://stackoverflow.com/questions/22507189/could-not-load-file-or-assembly-newtonsoft-json-version-4-5-0-0-culture-neutr – MPR Mar 22 '17 at 17:20
  • Thanks for the link! I'm looking over it right now, and I've tried a couple of these solutions. I removed and replaced the reference to Newtonsoft.Json. And I've tried to update the bindingRedirect. – will Mar 22 '17 at 17:34

2 Answers2

0

I had this problem when starting an .exe because the dll wasnt in the working directory.

Did you already check that the Newtonsoft dll is in the right directory - from where you launch the Project?

Dominik Lemberger
  • 2,287
  • 2
  • 21
  • 33
0

Make sure to use the same version Newtonsoft in all projects in your solution.

I had this "system cannot find the file specified" runtime issue when I called a .net framework classlib (project 1) linking NewtonSoft 10.0.3 from a main program (project 2) that linked NewtonSoft 6.0.4

After updating NewtonSoft in the main program to 10.0.3, issue was solved.

Goodies
  • 1,951
  • 21
  • 26