Debugging the content pipeline

Originally posted to Shawn Hargreaves Blog on MSDN, Wednesday, November 8, 2006

Content pipeline importers and processors run inside Visual Studio as part of building your game. This means you can't just debug into them like you would for normal game code.

Fortunately, the CLR provides a handy way of hooking a debugger up to any managed program you like. You just need to modify your processor code, adding this line at the point where you want to start debugging:

    System.Diagnostics.Debugger.Launch();

Now when you build your game, when the processor hits this line it will pop up a window titled "Visual Studio Just-In-Time Debugger", listing all the possible debuggers that are installed on your system. You will generally want to pick "New instance of Microsoft CLR Debugger 2005", which will connect to your processor and let you debug what is going on during your content build.

Blog index   -   Back to my homepage