How to serialize any object?

Can i serialize any poco object to type of xml, json or another. Is Reflection.Serialize() not imposible?


I don’t think this is implemented in NETMF.

Goto and search for json

Hımm, it’s great. Do you have json parser?

Always worth checking the WiKi.

If you are using one of GHI’s “smallest” offerings (e.g. Panda), serialization doesn’t work. You have to roll your own code.


For serialization on the Panda II (to send POCOs across a serial connection in my case) I’ve rolled my own. Basically, I have a Serialize() and Deserialize() method on an object where I turn it into a byte[] or rehydrate an object from a byte[].



//convert a byte array to a string
char[] CharArray = System.Text.UTF8Encoding.UTF8.GetChars(somebyteArray);
string someString = new string(nameCharArray);

//convert a string to a byte array
byte[] someBytes = System.Text.Encoding.UTF8.GetBytes("Good Luck");