JsonException: Max allowed object depth reached while trying to export from type System.Single

在进行类转json字符串时,报错JsonException: Max allowed object depth reached while trying to export from type System.Single。

ok,实际上是类的属性中有json不能识别的数据类型,我这里就脑残的float。去除掉之后就ok了。

(备注:用的是LitJson)

那一般什么类型是允许的呢?

我在JsonData类中找到了答案。

        public JsonData(bool boolean);
        public JsonData(double number);
        public JsonData(int number);
        public JsonData(long number);
        public JsonData(object obj);
        public JsonData(string str);

所以去除掉float吧!

时间: 2024-08-30 02:17:43

JsonException: Max allowed object depth reached while trying to export from type System.Single的相关文章

ef core 自引用类 报错System.Text.Json.JsonException: A possible object cycle was detected which is not supported....

ef core 创建自引用灰了了 public class Menu:IEntity { public int Id { get; set; } public string text { get; set; } public bool group { get; set; } public bool shortout_root { get; set; } public string link { get; set; } public string icon { get; set; } public

redis报错“max number of clients reached"

查看redis监控的时候看到redis的graph出现不正常的情况,截图如下: 如上面截图所展示的样子,可以看到redis 的客户端连接数很突兀的上升到10K,又突然下降到0.排除了监控本身的原因,很明显是因为redis本身出了问题. 进入redis服务器,连接上去 /usr/bin/redis-cli -p 6399 -h 127.0.0.1 >127.0.0.1:6399>> info ERR max number of clients reached 无论执行命令,显示的都是上面的

【转】redis报错“max number of clients reached"

查看redis监控的时候看到redis的graph出现不正常的情况,截图如下: 如上面截图所展示的样子,可以看到redis 的客户端连接数很突兀的上升到10K,又突然下降到0.排除了监控本身的原因,很明显是因为redis本身出了问题. 进入redis服务器,连接上去 /usr/bin/redis-cli -p 6399 -h 127.0.0.1 >127.0.0.1:6399>> info ERR max number of clients reached 无论执行命令,显示的都是上面的

The type 'System.Object' is defined in an assembly that is not referenced

记录一个错误,报 The type 'System.Object' is defined in an assembly that is not referenced,[System.Runtime] 配置文件加上后仍报错! <system.web> <compilation debug="true" targetFramework="4.5"> <assemblies> <add assembly="System.

Unable to cast object of type &#39;System.Int32&#39; to type &#39;System.String&#39;.

最近在研究.netcore,尝试把前后端完全分离.但是在写接口的时候,Post参数是FromBody的时候报错了 Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. System.InvalidCastException: Unable to cast object of type

SQLSERVER:Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

1.Max Pool Size 默认为100. 2.查看当前数据库连接数量, select * from sysprocesses where dbid= db_id('数据库名称') 结果为190, 3.添加数据库查询的最大连接数量 Data Source=.;Initial Catalog=i_Master;Persist Security Info=True;User ID=NUser;Password=N2;max pool size=500设置最大连接数量 500 原文地址:https

Reported time is too far out of sync with master. Time difference of 52692ms &gt; max allowed of 30000ms

RegionServer与Master的时间不一致造成的.由错误内容可以看出两台机器之间最大的误差时间为30000ms,一旦超过这个值便无法启动. 解决办法:同步RegionServer与Master的时间,最好周期性同步,具体方法请参考Linux时间同步设置: http://www.cnblogs.com/hunttown/p/5470527.html

生产redis client 链接报:ERR max number of clients reached 含义: 达到最大客户端数错误

1.通过netstat 命令查看TCP又11822个连接  (netstat命令是一个监控TCP/IP网络的非常有用的工具) 2.默认redis最大的连接数10000 ,但是此时无法连接redis客户端3.因为redis无法重启,否则会导致大量的应用无法访问,解决办法停止连接数最多的服务器应用4.只能在线调整参数,进入redis客户端,修改最大连接数 5.并且调整timeout   (当一个redis-client一直没有请求发向server端,那么server端有权主动关闭这个连接,可以通过t

Java语言API,Object类、StringBuilder、Date时间获取、System类常用

Object类Java.lang.Object(类):是Java中任何"引用类型"的父类.包括自定义的类.类库中的类.数组 都继承了toString()和equals()方法 1.toString方法:打印引用类型时,会自动调用toString方法,但是父类Object中的toString方法打印的是地址值,需要在自类中重写toString方法,以输出所有属性的值 2.equals方法:equals方法是比较两个对象的所有属性是否相同, 如果没有覆盖重写equals方法,那么Objec