Some tips for C # debug

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.