vs2012 when debugging, print variable values to Output window

Source: Internet
Author: User

1, in the debugging process, want to output the value of a variable to vs output window, rather than by adding breakpoints, each debugging, step-by-step look at the value of the variable, very troublesome, with Console.WriteLine (str); No, this command can only be used in console applications.

2, to output the value of the variable, the specific steps are as follows

1, determine the output variables such as I

2, at the end of the variable I break the point of a line

3, message on this breakpoint, add a hit condition to the breakpoint

4, in the Hit Condition dialog box, select the print message, print the format template of the message, such as: i = {i}, dialog box with specific instructions below

5, you can select the conditions in the dialog box to continue execution, so that the breakpoint value will not be interrupted, but will output the value of the variable to the outputs window, OK, the shape of the breakpoint and round programming square

6, run the program, to the Output window total view variable value,

The diagram used is as follows:

1,


2,


3,


4,


Complete


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: info-contact@alibabacloud.com 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.