Tipo33
Tipo33

Reputation: 181

C# Package not found on build even after installing

I installed the Newtonsoft.Json package through terminal on VS Code. On running the command "dotnet run" I get the error message:

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

together with other associated error messages.

How would I address this issue? Thanks

Upvotes: 0

Views: 2110

Answers (2)

Tipo33
Tipo33

Reputation: 181

Based on John's questions above, I found that my installation may have been faulty, so I used "dotnet add package Newtonsoft.Json" to install Newsoft.

Upon restarting VS Code, I found that the errors had disappeared. My sincerest thanks to everyone here in helping me solve this issue.

Upvotes: 1

Yoosh
Yoosh

Reputation: 67

Try run dotnet build first then dotnet run.

The command depends on the dotnet build command to build the code. https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run?tabs=netcore30

Upvotes: 1

Related Questions