How to debug a custom ContentTypeWriter

I’ve been trying to work on a custom content processor for the content pipeline, but I’m not quite sure how to debug this. I’ve looked at other topics but they weren’t really of much help.

Right now I have a breakpoint in my custom ContentTypeWriter that I’d like to hit.

These are the steps I’m taking;

  • Open op the MGCB.exe
  • Select Build -> Debug
  • Select Rebuild

This window pops up:

I can’t actually select anything with my cursor, but hitting enter does the trick. But then I just get a blank screen

I can actually understand that I’m not able to peek into MGCB.exe since I didn’t build it myself. But I’m not quite sure how to set this up properly.

Thanks in advance!

For debugging, you really will want to build MGCB yourself from source.

Ahh that’s what I guessed. What do I do once I build it from source though? My guess is it won’t automagically enable me to step through the code in my ContentTypeWriter, since that’s file is in a different project alltogether

I typically run MGCB directly from Visual Studio and pass it the parameters, including /rebuild so it always runs your content pipeline extension. Even better, make a small .mgcb file that just has one asset for testing purposes.

Command: $(TargetPath)
Command Arguments: /rebuild /@:Content.mgcb
Working Directory: path containing the .mgcb file