如何在.NET Core中反序列化NetDataContractSerializer数据? [英] How to deserialize NetDataContractSerializer data in .NET Core?

查看:125
本文介绍了如何在.NET Core中反序列化NetDataContractSerializer数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的.NET Framework WCF服务,该服务返回使用NetDataContractSerializer序列化的数据,各种.NET Framework客户端都会使用该服务.

I have an existing .NET Framework WCF service which returns data serialized using the NetDataContractSerializer, this is consumed by various .NET Framework clients.

我现在想编写一个也会使用它的新客户端应用程序,但是我的新客户端将用.NET Core编写.

I now want to write a new client application which will also consume it, but my new client will be written in .NET Core.

.NET Core的Windows兼容性包提供了使用WCF服务所需的大多数API,但是似乎缺少此关键NetDataContractSerializer类.

The Windows Compatibility Pack for .NET Core provides most of the APIs necessary to consume WCF services, however this key NetDataContractSerializer class seems to be missing.

是否可以将这些数据反序列化为.NET Core应用程序? 这些类型本身位于共享的.NET Framework程序集中,该程序集恰好与.NET Standard兼容,因此可以毫无问题地加载到.NET Core应用程序中.

Is there any way of deserialising this data into a .NET Core app? The types themselves are in a shared .NET Framework assembly which happens to be .NET Standard compatible so that can be loaded in the .NET Core app no problem.

推荐答案

.Net Core中没有NetDataContractSerializer时,您可以尝试使用以下端口 NetDataContractSerializer库.这几乎是.Net Framework System.Runtime.Serialization库的.Net Core端口.

While NetDataContractSerializer not available in .Net Core you can try this port of NetDataContractSerializer library. This is almost complete .Net Core port of .Net Framework System.Runtime.Serialization library.

这篇关于如何在.NET Core中反序列化NetDataContractSerializer数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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