类型名称“ serializeObject”在类型“ JsonConvert”中不存在

时间:2020-04-24 19:48:58

标签: asp.net-core cloudflare

我正在尝试将一些数据转换为Json以发送到CloudFlare API。我正在尝试使用Newtonsoft.Json.JsonConvert.SeriablizeObject()完成此操作,但出现了智能感知错误,即类型名称“ serializeObject”在类型“ JsonConvert”中不存在。我安装了NuGet包Newtonsoft.Json,但无法识别SerializeObject()方法。我不确定我缺少什么。

enter image description here

1 个答案:

答案 0 :(得分:2)

由于您错误地调用了该方法,因此请从该行中删除新的运算符

var json = new JsonConvert.SerializeObject(updateDnsRecord);

var json = JsonConvert.SerializeObject(updateDnsRecord);
相关问题