如何修复 Newtonsoft.Json using 语句的错误?

How can I fix the error on Newtonsoft.Json using statement?

我正在使用 C# 开发 .Net 控制台应用程序,我刚刚添加了 Newtonsoft.Json using 语句,但 VS 代码将其指出为错误

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

并建议我删除不必要的 using 语句,但这并不是不必要的,因为我需要它进行序列化。 这是一个普遍问题还是我做错了什么? An Image showing the error prompt

您遇到异常是因为编译器找不到 Newtonsoft 库。您将需要确保已安装它并将其添加为参考。您可以通过 NuGET 或手动添加库作为参考。