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\$
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..

http://blogs.msdn.com/b/shawnhar/archive/2006/11/08/debugging-the-content-pipeline.aspx

Other interestig point, when you are debugging this way a processor, is that shouldn't assign the processor to more than one assset, because if it has not been changed, I remember be asked for debug every assset... it's not funny when you have asssigned 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.

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.content.pipeline.contentprocessorcontext.logger.aspx

\$\endgroup\$
  • \$\begingroup\$ This works! Thank you so much. Now to actually solve the problem... \$\endgroup\$ – JMRboosties May 2 '12 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\$
  • \$\begingroup\$ That throws Error loading pipeline assembly when I try to run it, unfortunately. \$\endgroup\$ – JMRboosties May 1 '12 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\$ – JMRboosties May 1 '12 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.