Some tips for C # debug
Professional work also fast two years, from the beginning of the F9,F10 breakpoint debugging, slowly accumulate some debugging skills, make development work more efficient
1.F9 the most basic breakpoint, click F10 do not jump inside the method, click F11 Step by Step debugging, encounter method into the method of internal debugging
2. Conditional breakpoints and hit count breakpoints are useful when you encounter a for or foreach loop specific number of times in a job to get what we want to be worth.
3. When debugging, the arrow on the left side of the breakpoint, represents the location of the debugging, in fact, it can be freely dragged with the mouse
4. When debugging, we use the right mouse click, there are two debugging helpful features, run to the cursor, set to the next statement
Run to the cursor: according to the logic of the program, executed in order to the location you specify, his order is the program normal running direction, can not be specified
Set to Next statement: This function is very arbitrary, you can use to specify which part of the program to run, do not follow the direction of the program, you can repeatedly run the same method
5. Hover over the value of the variable can be displayed in the value of the box to modify values, class variables inside the properties can also be modified, static variables cannot be modified
6.C/S program, in the property generation target platform set to 86-bit program, you can modify the program when the program debugging, and click F5, you can not restart the program can immediately use your newly added code
You cannot add all variables and methods at this time, or you will still need to restart to use your newly added variables and methods
7. Key combination: Ctrl +d +i use Immediate window, in this window you can re-modify the worth of variables, new add code to run
8. During debugging, right-click the mouse to see the quick Watch and add monitoring buttons
Fast monitoring: You can view the values of the specified variables and objects, as well as the properties of the class object, and you can do some simple conversion code in this area.
Add monitoring: This function is to better see the value of the variable immediately, when the system appears because the specified value of the problem, but do not know in that step or method changes in the value, then this function is particularly important he can let us narrow the scope of the debugging
Some tips for C # debug