Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

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

share|improve this answer
    
This works! Thank you so much. Now to actually solve the problem... –  JMRboosties May 2 '12 at 3:12
add comment

Check out the project template made by Stephen Styrchak.

share|improve this answer
add comment

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.

share|improve this answer
    
That throws Error loading pipeline assembly when I try to run it, unfortunately. –  JMRboosties May 1 '12 at 4:22
    
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. –  JMRboosties May 1 '12 at 6:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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