2
votes

So there I am, working on a Silverlight app, and between one build & run and the next, my debug output goes away. Where before I had dozens of lines of Debug.Writeline text, I now have only the module load and thread messages.

Yes, I'm in debug mode (vs. release mode).

Yes, my Output window says "Show output from: Debug".

Yes, when I right-click on the output window, every option is checked.

No, my Tools > options > debugging > general > "Redirect all output text to the immediate window" is not checked.

All I can figure (and it's a wild guess) is that for some reason, the VS debugger isn't attaching to the Silverlight app like it should.

What's weird is this has been happening for the last couple of days, out of the blue. And just as suddenly, all my debug messages start showing up again.

This is VERY frustrating.

EDIT: Of course, after returning to the project after the weekend, all Debug messages are back. No idea what was causing the issue, so I'm sure it will happen again.

Now the question is: should I leave this question open in case the problem arises again in the near future? What happens to an unawarded bounty?

5
In situations like yours, I approach the problem by cutting things out until they work again. Depending on the size of your project, how many people are working on it, etc. this might not be easy, but can you create a new project, get your Debug.Writeline provably working, and start moving things over? I'm sorry if this sounds obvious, but it can do wonders to identify whether it's a general Visual Studio issue, a project issue, or a code issue.vpiTriumph
Are you compiling for more than one platform?WhiteKnight
@vpiTriumph: I've done exactly what you suggest on other projects. It's definitely a solution of last resort because it often hides the cause of the problem. In this case, it's an enterprise solution and would be a nightmare to re-construct.Klay
Only duplicate questions should ever be closed, but as you don't know what caused the problem, your question isn't really answered. If you don't manually award the bounty the reputation doesn't get awarded to anybody. See stackoverflow.com/faq#bounty for more information.WhiteKnight

5 Answers

2
votes

I found the same problem and just by setting optionsdebuggingoutput windowThread Exit Messages to true the output windows was begin to send the right messages !?

2
votes

I had exactly the same issue. Out of the blue, debug.print stopped working. In my case, it used to go to the Immediate Window. Nothing there. Nothing in the Output window. I followed several suggestions to no avail until I found this one at http://www.experts-exchange.com/questions/26894732/Debug-Print-and-Debug-Write-no-longer-work-in-Visual-Studio-2010.html

There is a context menu in the Output/Debug pane. The "Program Output" menu item was accidentally cleared.

Checked the item and it started working again (even though my output was the immediate window). What a relief...

1
votes

Ensure that the DEBUG conditional compilation symbol is defined. The Debug class suggests that you "add the /d:DEBUG option to the compiler command line when you compile your code using a command line, or add #define DEBUG to the top of your file".

0
votes

Did you create or modify an Application config? If yes: the initial created configuration by VS does contains the necessary wiring configurations to enable the debugging at all. Not sure what and if there are counterparts in Silverlight, but in WPF environments simply replacing the app.config will have the same effect as you expierience.

0
votes

Check the Immediate Window. Check the options. There is a general setting that says "send Debug output to Immediate Window"