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

查看:24
本文介绍了如何在 .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 github 上打开了这个 issue 来跟踪这个功能:

It seems like this is not possible, therefore I have opened this issue on the .NET Core github to track this feature:

https://github.com/dotnet/corefx/issues/33120

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

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