Reputation: 181
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
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
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