Share via


The type or namespace name 'Newtonsoft' could not be found

Question

Thursday, December 24, 2015 11:19 AM

Hello

As you can see on this image: https://gyazo.com/b4958b016d4f28befbda2e2adfcf0ef9

When i am done with coding my program, and i want to build my soulution. It came up with this 

Error:  The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)

I dont know how to fix this. (I am beginner).

Regards Jens

All replies (7)

Friday, December 25, 2015 5:12 PM âś…Answered

Hi Jens Birk,

Forget to tell, you need to have net connection turned on to download packages from internet. If still its not working try downloading NewtonSoft directly from

https://github.com/JamesNK/Newtonsoft.Json/releases.

Unzip the downloaded file & copy Newtonsoft.Json.dll from the folder that matches your project Framework version & coy to the desired folder (namely lib in your project). Add a manual project reference to Newtonsoft.Json.dll & compile...

It all Happenz Sendil


Thursday, December 24, 2015 3:12 PM

You can resolve this issue in two ways

Option 1

Tools-> NuGet Package Manager -> Package Manager Settings General
Check "Allow NuGet to download missing packages" &
Also check "Automaticall check for missing packages during build in Visual Studio"

Option 2

1. View\Other Windows\Package Manager Console
2. If your solution has only one project skip this step else In "Default Project" Select the project which in which error occurs
3. In PM> type "install-package Newtonsoft.Json"

Issue will be resolved.

It all Happenz Sendil


Friday, December 25, 2015 7:50 AM

Thanks for sendilg's reply.

Hi Jens Birk,

Please try sednilg's suggestion first. If that doesn't work, then please create a new blank project to check whether the new project also has the same problem.

If the problem just occurs with this specific project, please tell us which project type you created and share some code snipped to help us reproduce this problem.

If this problem occurs with all projects, please try with following steps to troubleshoot this problem.

  1. Run Visual Studio as administrator.
  2. Close all third part software, such as antivirus.
  3. Reset all settings by menu Tools -> Import and Export settings -> Reset all settings.
  4. Repair your Visual Studio.

Best Regards,
Weiwei


Friday, December 25, 2015 8:43 AM

Hello Happenz Sendil

Its not working, should i repair or restart visual studio after i did my changes?

Its not working still..

Regards Jens


Friday, December 25, 2015 9:33 AM

Hello Weiwei 

I tried your method, but still not working.. just say this error again: https://gyazo.com/ef19a9881ca1a92918620c8a70d40a43

Regards Jens


Friday, December 25, 2015 9:35 AM

Hi Jens Birk,

Is this problem occurs with all project or just this specific project?

Best Regards,
Weiwei


Friday, December 25, 2015 10:47 AM

Hello Weiwei 

All projects

Regards Jens