I'm taking an intro class and I'm having trouble with the debugging feature in C#. When I try to run the debugger, it executes the code so quickly that the watch feature pops up and disappears before I can read anything. I'm unsure why this is happening, and I don't have any classmates to ask for help. Any thoughts?
2 Answers
Have you tried setting a breakpoint at a specific line? That way, the debugger will pause just before that line executes, allowing you ample time to inspect the program's state.
It sounds like you're running into a console program issue where the console closes immediately after execution. A simple fix for this is adding `Console.ReadLine()` at the end of your program to keep the window open until you press enter.
Not the output... that's showing up fine. Sorry if I'm not explaining this right, but you know how in GitHub you can debug and watch the program run? It just pops up and goes away too fast once the code is executed.
Thanks man!!! That worked!!!