简体   繁体   English

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

[英]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.

相关问题 错误:类型名称“X”不存在于类型“Y”中 - Error: The type name 'X' does not exist in the type 'Y' 命名空间类型不存在 - Type of namespace does not exist 命名空间“System.ComponentModel”中不存在类型或命名空间名称“DataAnnotations” - type or namespace name 'DataAnnotations' does not exist in the namespace 'System.ComponentModel' 命名空间“WebApplication1.Models”中不存在类型或命名空间名称“Application” - The type or namespace name 'Application' does not exist in the namespace 'WebApplication1.Models' 类型或名称空间名称“ SqlServer”在名称空间“ Microsoft.EntityFrameworkCore”中不存在 - The type or namespace name 'SqlServer' does not exist in the namespace 'Microsoft.EntityFrameworkCore' 命名空间“Microsoft”中不存在类型或命名空间名称“EntityFrameworkCore” - The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft 发布到Azure时,类型或名称空间名称“AspNetCore”不存在错误 - Type or Namespace Name “AspNetCore” does not exist error when publishing to Azure 类型或命名空间名称Web在命名空间系统中不存在 - Type or Namespace name Web does not exist in the namespace system 类型或名称空间名称“ Relational”在名称空间“ Microsoft.EntityFrameworkCore”中不存在 - The type or namespace name 'Relational' does not exist in the namespace 'Microsoft.EntityFrameworkCore' NewtonSoft JsonConvert.SerializeObject 确实将零序列化为负零( 0 序列化为 -0.0 ) - NewtonSoft JsonConvert.SerializeObject does serialize zero to negative zero ( 0 serialized like as -0.0 )
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM