本文介绍了紧凑框架3.5是否支持System.Runtime.Serialization?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个库,它是一组类,旨在在许多不同的.NET应用程序之间共享,包括至少一个使用.NET Compact Framework的类.我一直在使这些类将[DataContract]属性与一堆[DataMember]一起使用,以便使用DataContractJSONSerializer可以轻松地对它们进行序列化和反序列化.我一直在网上搜索以尝试确定.NET Compact Framework 3.5是否支持此功能(DataContractAttribute,DataMemberAttribute和DataContractJsonSerializer),但我什至没有运气,甚至无法在.NET Compact Framework 3.5中找到受支持的类的完整列表. .NET Framework.

I am writing a library which is a set of classes meant to be shared between many different .NET applications, including at least one which uses the .NET compact framework. I have been making these classes use the [DataContract] attribute with a bunch of [DataMember]s so that they are easy to serialize and deserialize using the DataContractJSONSerializer. I have been searching the web to try to find out if this functionality (DataContractAttribute, DataMemberAttribute, and DataContractJsonSerializer) is supported in the .NET Compact Framework 3.5 but I have had no luck even being able to find a full list of supported classes in the .NET Framework.

有人碰巧知道对这些功能的支持程度吗?

Does anyone happen to know the extent of support for these functions?

推荐答案

我相信.net 3.5 CE中存在System.Runtime.Serialization命名空间.这是完整的命名空间列表,但似乎其中不支持您感兴趣的任何功能.

I believe that System.Runtime.Serialization namespace exists in .net 3.5 CE. Here is complete list of namespaces, but it looks like any of functionalities you are interested are not supported within it.

据我了解,您正在尝试创建一些可以序列化的实体库.我认为您需要针对.net CE应用程序使用另一种方法.说不同的库(或相同的代码,但为ce编译并定义了指令).然后,您将需要利用一些外部库进行json序列化(如果仍然需要).

As I understood you are trying to create some entities library which can be serialized. I think you need to have another approach for your .net CE application. Say different library (or same code but compiled for ce with directives defined). Then you would need to utilize some external library for json serialization (if you still need it).

还考虑使用另一种序列化机制代替DataContractJsonSerializer.从此处的另一个好问题开始.

Also think about using another serialization mechanism instead of DataContractJsonSerializer. Start with another good question here at SO.

如果您尝试使用某些服务,则有帖子,其中讨论了类似的问题.他们建议的是拥有一些中间层.

If you are trying to work with some services, there is post on msdn forum, where similar issue discussed. What they propose is to have some middle tier.

无论如何,使用.NET 3.5 CE所做的任何事情都会变得困难,因为老实说,这是一种过时的技术.

Anyway whatever you do with .NET 3.5 CE is going to be hard as, honestly, it is an outdated technology.

这篇关于紧凑框架3.5是否支持System.Runtime.Serialization?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 08:44