0
votes

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?

2
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

2 Answers

0
votes

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?

0
votes

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.