0

All...

I hate to ask this question since it has many many posts. I find the earliest is 12 years ago and things have changed since then, eh? Other posts ask about Console.Write()...etc, but not Debug.Print(). My VS2019 multi-project solution is for Blazor PWA web application. But I just do not understand why Debug.Print() statements are not going to the Output window. This should be "simple" and judging from the other posts it is NOT simple. Evidently something is NOT in place to have this happen.

Yes, I start the debugging using -key. In my Tools>Options>Debugging>General, "Redirect all output to Immediate Window" is UNCHECKED. I have NO idea what are and thus I cannot set them. This should not be this difficult.

Someone, please help me. Thanks. John D.

John D
  • 517
  • 7
  • 22
  • I closed this as a dup. The question is in VB, but the (second) answer there (in C#) is what you want. By default, trace output doesn't go to the console, so you have to configure that -- `Program.cs` is a good place. Succinctly, you need to add this line: `Trace.Listeners.Add(new ConsoleTraceListener());` – Kirk Woll Oct 27 '21 at 13:25
  • Thank you @Kirk Woll. You fixed it!!! This is the answer -- Debug.Print(...) works for me! Thx. However I wonder why the VS2019 project does not automatically set this "line" for us. LOL --Kirk...if you restate your reply as an answer, I will set it for you. Thanks. – John D Oct 27 '21 at 20:43

0 Answers0