type or namespace name 'Newtonsoft' could not be found

When you copy files of a solutions, some references can be "lost". Try to delete the reference and add it again, after you copied the files and open in the other machine.

Also, take a look at this question: reference dll not copying to bin with deployment project causing error


First step is try to rebuild your project. If it doesn't help: find 'Newtonsoft' in 'Nuget package Manager' and uninstall it. If it have a references => put checkboxes (Remove dependencies, Force uninstall) and in dropdowns (Dependency behavior => Ignore dependencies, File conflict action => Ignore All)

Install 'Newtonsoft' again.


The best way to fix this is to "Clean Solution"

In the solutions explorer in Visual studio, Right-click on the solution and Select "Clean Solution"

Clean Solution - deletes all compiled files (all dll’s and exe’s ).
Build Solution - compiles code files (dll and exe) that have changed.
Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.

Reference: https://bitwizards.com/thought-leadership/blog/2014/august-2014/visual-studio-why-clean-build-rebuild


Thanks for the pointer and the link. After a struggle I got it to work. What finally happened was my friend, an expert in .NET Skyped me and talked me through the proper way of deploying my project to the destination server. I didn't understand that there is a separate folder where your Build goes. I made a "Build Deployment Package" as a zip file. Then I unzipped it on my hard drive, and dropped it into a clean folder on the web server (actually, I uploaded it to the root directory), and voila, it worked.

Tags:

.Net

Json.Net