binaryformatter

.NET Remoting, why isn't a list remotable?

岁酱吖の 提交于 2019-12-21 19:26:03
问题 I'm using RemotingServices.Marshal and Activator.GetObject to establish a remoting channel between two simple programs residing on the same computer. public class IpcInterface : MarshalByRefObject { public int number = -1; public string text = "default"; public List<String> strings; } // A simplification I've confirmed that the channel exists and communication is possible, because both programs are successfully changing number and text to completely unique values (confirmed). So I immediately

BinaryFormatter in netstandard 1.5

笑着哭i 提交于 2019-12-21 18:03:59
问题 According to the List of .NET CoreFx APIs and their associated .NET Platform Standard version, System.Runtime.Serialization.Formatters is added into to the .NET Platform Standard since 1.3, which is cool, but when I try to create a .Net Core class library targeting netstandard1.5 under.Net Core RC2, I can't use it. The code is simple, just intending to declare a BinaryFormatter: public class Problems { private System.Runtime.Serialization.Formatters.Binary.BinaryFormatter _formatter; } Error

ExtensionDataObject not marked as serializable

与世无争的帅哥 提交于 2019-12-20 03:30:13
问题 Oi! I'm having issues serializing my session state. We have 2 components, our WCF and Web. Based on our AdministrationPartial.cs and Administration.svc we generate "Administration.cs" code for our web project with the following .bat file : svcutil.exe http://wcf_url.local/Administration.svc?wsdl /r:"{Path}\{Namespace}.dll" /d:"{Path}\{Namespace}\Code" I removed the personal data from the above statement and replaced it with {path} and {namespace}. The Administration.cs will be inside the Code

BinaryFormatter alternative

旧街凉风 提交于 2019-12-20 02:15:14
问题 I am shopping for a BinaryFormatter alternative/replacement. The current issues I have with BinaryFormatter (and the alternatives should address this) are 1) backwards compatibility (can deserialize Classes serialized using an earlier version) 2) size 3) speed I have checked out AltSerializer which looks ok, some conflicting reports on speed however it looks like it supports backwards compatibility. I also looked at protobuf-net which looks fantastic except at this stage it would require alot

BinaryFormatter deserialize gives SerializationException

流过昼夜 提交于 2019-12-18 14:48:32
问题 I'm getting an: System.Runtime.Serialization.SerializationException: Unable to find assembly 'myNameSpace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null When trying to deserialize some data in another program than the program I serialized it with. After some googling I've found out that apparently this can only be done using a shared assembly. However, my database is full with this serialized objects, and I need a utility program to get them out. Is there a way to override this

Assembly Independent Serialization in .NET

断了今生、忘了曾经 提交于 2019-12-18 05:54:18
问题 I use Serialization/DeSerialization Technique. BinaryFormatter class. Each time when new assembly is created the BinaryFormatter can't Deserialize binary data even if the class structure is the same, but the Assembly version differs. Is it possible to Deserialize binary buffer with no checking the assembly version if the class structure stays unchanged? 回答1: Try this: public sealed class CurrentAssemblyDeserializationBinder : SerializationBinder { public override Type BindToType(string

Dictionary is empty on deserialization

两盒软妹~` 提交于 2019-12-17 20:50:57
问题 I'm currently writing a bidirectional map class, and I'm having some troubles with the serialization/deserialization of the class (question at bottom). Here's the parts of the class that's relevant. /// <summary> /// Represents a dictionary where both keys and values are unique, and the mapping between them is bidirectional. /// </summary> /// <typeparam name="TKey"> The type of the keys in the dictionary. </typeparam> /// <typeparam name="TValue"> The type of the values in the dictionary. <

.Net Where to find the official specification of the BinaryFormatter serialization format?

删除回忆录丶 提交于 2019-12-17 16:04:33
问题 I'd like to know what is the serialization format of the BinaryFormatter. I found this site which give some good informations, but it was obtained by reverse engineering and it is not complete. Where can I find the official specification of the BinaryFormatter serialization format? 回答1: [MS-NRBF]: .NET Remoting: Binary Format Data Structure 来源: https://stackoverflow.com/questions/2044111/net-where-to-find-the-official-specification-of-the-binaryformatter-serializati

BinaryFormatter and Deserialization Complex objects

佐手、 提交于 2019-12-17 11:28:51
问题 Can not deserialize following object graph. That Exception occurs when deserialize method called on BinaryFormmater: System.Runtime.Serialization.SerializationException : The constructor to deserialize an object of type 'C' was not found. There're two constructor on C. and I think the problem may be : While serialization Binaryformatter using the paramatered one and on deserialization process, it needs a parameterless one. Is there a hack / solution? Objects : [Serializable] public class A {

Using BinaryFormatter and XmlSerializer interchangeably

随声附和 提交于 2019-12-13 16:52:22
问题 I've inherited a large amount of code that uses BinaryFormatter for serialization, that I now need to debug. All the serialization code currently expects an IFormatter. I had a idea to replace the BinaryFormatter with an XmlSerializer, to make examining the serialized output easier, but they aren't compatible (no common base or interface). Is there a standard approach to this e.g. make the parameter some kind of generic serializer that my code can use? Ideally I'd like to create whichever