小编arm*_*o t的帖子

我不能使用'services.AddControllers().AddNewtonsoftJson()'

我在 Net core 3.1 中,我正在尝试使用 AddNewtonsoftJson()

我越来越:

“IMvcBuilder' 不包含'AddNewtonsoftJson' 的定义,并且找不到接受'IMvcBuilder' 类型的第一个参数的可访问扩展方法'AddNewtonsoftJson'(您是否缺少 using 指令或程序集引用?)”

这是我在我的 ConfigureService 中写的:

services.AddControllers().AddNewtonsoftJson();
Run Code Online (Sandbox Code Playgroud)

我已经在我的启动项目中安装了 NewtonSoft。

c# asp.net startup .net-core asp.net-core-webapi

1
推荐指数
1
解决办法
3066
查看次数

标签 统计

.net-core ×1

asp.net ×1

asp.net-core-webapi ×1

c# ×1

startup ×1