Wednesday, 11 August 2010

Forays in the Binary Serializer

I am currently working on some code that I'm hoping will become a tool that is able to view the output of .Net's BinarySerializer.

First a bit of background. I use Windows Workflow Foundation (WF) at my work and serialize its state to the database. As time has gone on and we have had different versions of the workflows and the objects they depend upon we have sometimes had problems deserializing older versions of workflows (I will do another post that will go in to the pitfalls and issues I'm talking about here).

To cut a long story short the error reporting of the BinarySerializer leaves much to be desired. Have you ever had something like: "Error deserializing a serializable property." and wished you could know anything about the context? The name of the property would be a great start.

Anyway after getting this one to many times and spending days finding a problem that was down to an assembly version not being updated I decided to look into being able to view the serialized data without being able to deserialize it.

All I could find was this document by Lluis Sanchez Gual. Who from what I can tell has figured out the format of the BinaryFormatter by brute force for the Mono Project. So I started writing a viewer from scratch. I am using Boo for no other reason than I want to learn it.

Over the next few posts I'll be sharing my findings and experiences while doing this. Hopefully there will be someone how finds this informative or even useful. At the very least this will be a place that I can came back to later to see what I was thinking.

Share and enjoy.

0 comments:

Post a Comment