Using IntermediateSerializer to discover XML format

Shawn Hargreaves posted an excellent article about using IntermediateSerializer to determine the XML format of an object in XNA by creating an instance of the object and then using IntermediateSerializer to write it to an XML file.

I’ve tried replicating this exact example with MonoGame, but I seem to end up with an empty XML file every time. The only difference from the example is that I have to use the MonoGame.Framework.Content.Pipeline.Portable package to access IntermediateSerializer since I’m using MonoGame and not XNA.

Anyone know why this might not be working?

Never mind! I managed to solve this by referencing the actual Content.Pipeline DLL instead of the Portable one. Works like a charm now.

Yeah, the PCL wouldn’t work as it is just a “bait and switch” stub class. Doesn’t contain any actual code.

The road to making MonoGame more portable is a long road.