JsonConvert DataSet .NET Core 2.0无法正常工作 [英] JsonConvert DataSet .NET Core 2.0 not working

查看:214
本文介绍了JsonConvert DataSet .NET Core 2.0无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此示例在.NET Core中似乎不再起作用2.0,现在使用XmlDiffGram进行序列化.有任何简单的方法可以使其正常工作吗?我是否需要执行

This example no longer seems to work in .NET Core 2.0, it now serializes using an XmlDiffGram. Any easy way to get it working? Do I need to do this whole thing?

推荐答案

看起来Netonsoft团队已经为数据表,它可以为您指明正确的方向.

It's looks like the Netonsoft crew have written a specific converters for DataSet & DataTables which should point you in the right direction.

快速更新: 看来这些尚未在最新的nuget版本中发布,但即将发布很快就.

Quick update: It looks like these are not quite in the latest nuget release yet, but coming soon.

发布它们时,您需要将示例中的行更改为类似的内容.

when they are released, you'll need to change the line in the example to something like.

string json = JsonConvert.SerializeObject(dataSet, Formatting.Indented, new JsonSerializerSettings { Converters = new[] { new Newtonsoft.Json.Converters.DataSetConverter() } });

这篇关于JsonConvert DataSet .NET Core 2.0无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆