当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - How to differentiate between binary serialization to store and serialization to pass objects across application domains

问题描述:

I'm porting my framework code from .NET 4.0 to 4.5 using portable class libraries. One thing I run into is that the SerializableAttribute is missing, which I used to enable binary serialization to store objects in the asp.net session state. I've seen people suggesting using DataContract as alternative but that won't help for the BinaryFormatter.

Basically I have 2 scenario's:

  • I'd like to store objects in the session state (out-of-process)

  • I'd like to be able to serialize them as well to JSON of XML to send them over the wire

What would be a good solution which enables me both?

分享给朋友:
您可能感兴趣的文章:
随机阅读: