[英]Type name 'serializeObject' does not exist in the type 'JsonConvert'
I am trying to convert some data to Json to send to the CloudFlare API.我正在尝试将一些数据转换为 Json 以发送到 CloudFlare API。 I am attempting to use Newtonsoft.Json.JsonConvert.SeriablizeObject() to accomplish this but I am getting the Intellisense error that the type name 'serializeObject' does not exist in the type 'JsonConvert'.
我正在尝试使用 Newtonsoft.Json.JsonConvert.SeriablizeObject() 来完成此操作,但我收到 Intellisense 错误,即类型名称“serializeObject”在“JsonConvert”类型中不存在。 I have the NuGet package Newtonsoft.Json installed but it does not recognize the SerializeObject() method.
我安装了 NuGet package Newtonsoft.Json,但它无法识别 SerializeObject() 方法。 I am not sure what I am missing.
我不确定我错过了什么。
Its because you're calling the method wrong, remove the new operator from the line这是因为您调用错误的方法,请从该行中删除 new 运算符
var json = new JsonConvert.SerializeObject(updateDnsRecord);
to至
var json = JsonConvert.SerializeObject(updateDnsRecord);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.