Search code examples
.netvb.netbinary-serialization

Example of a Customer Binary Serializer in .Net


So, I want to implement my own binary serialization. I'm looking for some examples to head me in the right direction.

Also, am I better to make my own serializer class, or just implement ISerializable and use BinarySerializer? If I implement Iserializable, does that get around the assembly loading/version dependency problems with BinarySerializer?


Solution

  • Check out protobuf-net written by Marc Gravell (a Stack Overflow guy)

    I would avoid implementing your own, unless you have to of course. The project is open source so you can check it out.

    I now use this after getting fed up with BinaryFormatter

    Using protobuf is easy and its ultra fast, and it does NOT experience the assembly loading/version dependency problems.

    Oh and if you need some performance stats, check this out. Fast!

    I asked a similar question about an alternative to BinaryFormatter