Questions tagged [iserializable]
53 questions
1
vote
1 answer
C#: [NonSerialized] when implementing ISerializable
I dont' understand the use of the [NonSerialized] attribute when implementing ISerializable on a class. I attended the "programming in C#" (Microsoft 20-483) course and it's used in few examples, but not in details.
Take this…

benichka
- 925
- 1
- 11
- 32
1
vote
1 answer
How often should each object's GetObjectData method be called during custom serialization?
I'm serializing the data in my app using custom serialization i.e. each of the classes I'm storing has the [Serializable] attribute and implements ISerializable. The object graph being serialized is reasonably complex with lots of cross-references…

Mal Ross
- 4,551
- 4
- 34
- 46
1
vote
2 answers
Socket.Send, server receive many invalid MPacket
[Serializable]
public class Packet : ISerializable
Packet is my class use for holding data, implemented ISerializable and all needed constructor and functions I read…

hackket_bboy
- 21
- 4
1
vote
0 answers
Serializing events with circular references using ISerializable
I have to deal with serializing a bunch of objects. For the sake of simplicity I am using the [Serializable] attribute together with the binary serializer and binary formatter, excluding non-neccessary fields with [NonSerialized] for most of the…

mvo
- 1,138
- 10
- 18
1
vote
1 answer
Linq-to-SQL overriding my OnSerializing attribute
My Code
partial class User
{
[OnSerializing]
public void ClearPassword()
{
Password = null;
…

Matthew James Davis
- 12,134
- 7
- 61
- 90
0
votes
3 answers
Sonar Qube Error Update this implementation of 'ISerializable' to conform to the recommended serialization pattern
I'm currently working on a .net 4.6.2 application.
I need to serialize an OData Api call and it works perfectly fine.
Unfortunately I'm getting a Sonar Qube Error:
Update this implementation of 'ISerializable' to conform to the recommended…

Bender.
- 71
- 6
0
votes
1 answer
Serialization/Deserialization with ISerializable
Good morning,
I am working on a C# application and I need to serialize an object with ISerializable interface but
I do not how to do it. My object has no properties, it just have some methods. See below the code :
public interface ILogger
{
…

Zaraki21
- 21
- 1
- 4
0
votes
1 answer
Cross-Process Drag and Drop of custom object type contain sorted list of XmlNodes in WinForms C#
I had a similar problem as the user posting at the following location:
Cross-Process Drag and Drop of custom object type in WinForms C#
Luckily, I have figured out how to serialize almost all parts of my custom object except for a SortedList object.…

KyleK
- 190
- 13
0
votes
0 answers
WCF Serialization using ISerializable Interface
This should be possible however I have searched extensively and have found no answers to this, using WCF ISerializable interface concept. Hopefully the experts can help.
Any documentation I have read only refers to info.AddValue(...) concept similar…

AshHegde
- 11
- 2
0
votes
2 answers
Using ISerializable breaks serialization for previously supported types
I'm trying to serialize/deserialize a custom class I have that has a System.Windows.Media.Color property. It wasn't working because Color doesn't have the [Serializable] Attribute. Based on some other articles, I decided to implement ISerializable,…

Olli
- 375
- 5
- 15
0
votes
0 answers
Custom object XML serialization whithout any xml tags
I would like to create a custom serializable "string" class to handle the default string formatting without implement the logic in all of the modells.
I created a serializable class with implicit string operator
[Serializable]
public class…

Smiley
- 68
- 6
0
votes
1 answer
C# custom serialization of a class with list of interfaces
I am trying to find a way to serialize and deserialize the ClassToSerialize below built like:
[Serializable]
public interface IFoo
{
}
[Serializable]
public class BaseFoo : IFoo
{
}
[Serializable]
public…

MihaiP.
- 133
- 2
- 10
0
votes
2 answers
How to serialize an ISerializable object into SOAP or Json or Xml
I have a complex object which is ISerializable and i want to serialize it into an XML document (node that i rather to not change the source code and add XML serialization attribute stuff).
ISerializable works fine with BinaryFormatter, but there is…

epsi1on
- 561
- 5
- 16
0
votes
1 answer
Error: "The deserializer has no knowledge of any type that maps to this contract"?
I have a class Foo marked [Serializable] and implementing ISerializable. I'm trying to serialize it via DataContractSerializer. In GetObjectData I do this:
info.AddValue("Test", new[] { 1,2,3});
It fails with:
Element ':Test' contains data of the…

Stefan Monov
- 11,332
- 10
- 63
- 120
0
votes
1 answer
How to Serialize collection
I have class with property of type ISet. I want to serialize that class but don't know how to do with ISet.
[Serializable]
class Question: ISerializable
{
private int id;
public int Id
{
get{return id;}
set{id = value;}
}
…

Kate
- 751
- 1
- 12
- 26