JsonException: Max allowed object depth reached while trying to export from type System.Single
2015-03-29 16:46
627 查看
在进行类转json字符串时,报错JsonException: Max allowed object depth reached while trying to export from type System.Single。
ok,实际上是类的属性中有json不能识别的数据类型,我这里就脑残的float。去除掉之后就ok了。
(备注:用的是LitJson)
那一般什么类型是允许的呢?
我在JsonData类中找到了答案。
[csharp] view plaincopy
public JsonData(bool boolean);
public JsonData(double number);
public JsonData(int number);
public JsonData(long number);
public JsonData(object obj);
public JsonData(string str);
ok,实际上是类的属性中有json不能识别的数据类型,我这里就脑残的float。去除掉之后就ok了。
(备注:用的是LitJson)
那一般什么类型是允许的呢?
我在JsonData类中找到了答案。
[csharp] view plaincopy
public JsonData(bool boolean);
public JsonData(double number);
public JsonData(int number);
public JsonData(long number);
public JsonData(object obj);
public JsonData(string str);
相关文章推荐
- JsonException: Max allowed object depth reached while trying to export from type System.Single
- Memcached ++++ exception thrown while trying to get object from cache for key
- Access restriction: The method typeNameToClass(String) from the type ObjectHandler is not accessible due to restriction on required library
- How to solve 'object of abstract class type "newFoo" is not allowed'?
- The method update(String, Object...) from the type JdbcTemplate refers to the missing type DataAcces
- Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.E
- Unable to cast COM object of type 'System.__ComObject' to class type 的解决办法
- How to convert a type object from unshared to shared.
- The object of type 'RectTransform' has been destroyed but you are still trying to access it
- 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.
- Activation error occured while trying to get instance of type Database
- (Entlib 5.0)Activation error occured while trying to get instance of type ICacheManager, key ""求解决办法
- The method queryForMap(String, Object...) from the type JdbcTemplate refers to the missing type DataAccessException
- Activation error occured while trying to get instance of type IcacheManager,key
- How to export/import data with LOB type from one user/schema to another
- ORA-04020: deadlock detected while trying to lock object 报错问题解决步骤
- System.InvalidCastException: Unable to cast object of type SqlDataProvider to type DataProvider
- Oracle 9i 升级中的bug-- Sys.Cdc_alter_ctable_before ORA-04020 deadlock detected while trying to lock object
- Oracle 9i 升级中的bug-- Sys.Cdc_alter_ctable_before ORA-04020 deadlock detected while trying to lock object
- To consume a managed type from COM 之三 Calling a .NET Object