2
During the development of an application, there are times when I get lost and want to understand how my code is running. For example, in which iteration of a particular loop of repetition it is, what is the value of a given variable.
Until then I did this by displaying dialog windows, which I then have to remove from the code. There are better ways to do this?
I’ve heard of namespace System.Diagnostics
, about trace / debug, tracking and debugging and also on the method Debug.WriteLine()
, but about the latter, I could not learn to use, because I could not find where he writes the information. What is the most efficient way to solve this problem?
If you put one breakpoint in your code (Click to the left of the line number or F9 in Visual Studio, put in the line that the courses are), and start the application in debug mode (F5 in Visual Studio), your code will stop when it reaches the line of breakpoint. You can see the values of all variables that currently exist, in addition to the properties of the instantiated classes, etc.
– Oralista de Sistemas