我在 Net core 3.1 中,我正在尝试使用 AddNewtonsoftJson()
我越来越:
“IMvcBuilder' 不包含'AddNewtonsoftJson' 的定义,并且找不到接受'IMvcBuilder' 类型的第一个参数的可访问扩展方法'AddNewtonsoftJson'(您是否缺少 using 指令或程序集引用?)”
这是我在我的 ConfigureService 中写的:
services.AddControllers().AddNewtonsoftJson();
Run Code Online (Sandbox Code Playgroud)
我已经在我的启动项目中安装了 NewtonSoft。