Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Visual-Studio / VS2017

Visual Studio 2017 – Run To Click

3.29/5 (3 votes)
22 May 2017CPOL2 min read 8.5K  
A quick tip about how the new Run To Click feature in Visual Studio 2017 can expedite your debugging experience.

Visual Studio 2017 has provided several key improvements in the Debugging experience. One of them is called “Run To Click”. “Run to cursor” has been a familiar experience for all developers for many years. This provided a convenient way of running your program to the cursor location using a short-cut such as Ctrl+F10. Of course, the same could also be achieved by adding a break-point on the line of code and hitting F5. Of course, adding a break-point meant that your program execution could be stopped at the same line again. However, both of these approaches have their own “latencies” that Visual Studio team decided to address in Visual Studio 2017. Let’s say your are debugging your program, during that you may notice green Glyph appearing as shown in the red rectangle in picture below.

1

Hovering the cursor on the glyph shows “Run execution to here” tooltip as shown below.

1a

If you click on the glyph here, the program execution will continue and stop at this line. In this example, user will be first prompted to enter the length of Fibonacci series. Let’s say the user enters a number 5 here.

2

Once user hits the enter key, the execution will stop on the same line.

3

That’s great. It certainly saves some time when debugging. But wait, things can be even better. From the code, we can see that the GenerateFibonacciSeries method will be called next within the if statement. Let’s say I want to debug the loop within that method. All I need to do is to take my mouse to that line and you will see the same green glyph there as shown below.

4

Just as the name of the feature says, you just “Run to Click” and it will take you right there.

5

As you can see from the Local window, the program execution stopped at the first iteration in the loop. If needed, you can click on the green glyph again on the same line and execution will stop on the second iteration of the same loop.

6

Until next time, happy debugging!!

Filed under: CodeProject, Visual Studio 2017
 Image 8

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)