6
\$\begingroup\$

I'm working with a custom made content pipeline designed to work with the program Tiled (using the TiledLibrary found here). I am running into trouble with the MapProcessor class in the custom content pipeline, and would like to be able to debug it to find out what exactly is going on.

However, when I try to use lines such as Console.WriteLine(...) or breakpoints, these lines are ignored by the debugger built into Visual Studio. Is the content pipeline barred from access to things like console writing and breakpoints? If so, is there a way to fix this?

I'm a bit new to C#, XNA, and Visual Studio, so bear with me if this is a dumb question. I tried googling my problem (as well as searching this stackexchange) but was unable to find any answers. Thanks!

\$\endgroup\$

3 Answers 3

4
\$\begingroup\$

You can launch a external debugger...

You only have to add the line System.Diagnostics.Debugger.Launch() and you will can debug it.

I think that you maybe need Visual Studio Professional or the .Net Framework SDK to use this solution... it was needed with the old XNA frameworks, now I'm not sure.

More info on debugging the content pipeline

Other interesting point, when you are debugging this way a processor, is that shouldn't assign the processor to more than one asset, because if it has not been changed, I remember be asked for debug every asset it's not funny when you have assigned the processor to 500+ assets.

If you want to launch warnings you have a Logger interface in your ContentProcessor context variable to let do it: ContentProcessorContext.Logger Property.

\$\endgroup\$
1
  • \$\begingroup\$ This works! Thank you so much. Now to actually solve the problem... \$\endgroup\$ May 2, 2012 at 3:12
1
\$\begingroup\$

Check out the project template made by Stephen Styrchak.

\$\endgroup\$
0
\$\begingroup\$

Make sure your game solution is selected and then go to:

Project -> Properties -> Application

Set the output type to Console application. This will show the console when you run your game so your Console.WriteLine() will appear.

\$\endgroup\$
2
  • \$\begingroup\$ That throws Error loading pipeline assembly when I try to run it, unfortunately. \$\endgroup\$ May 1, 2012 at 4:22
  • \$\begingroup\$ Think I figured out what you meant, I tried giving the application a console window, and while other console lines appeared in it, lines from the Pipeline did not. \$\endgroup\$ May 1, 2012 at 6:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .