Run to the Cursor in Visual Studio

Run To Cursor” it’s an alternative option of Breakpoints we can use that option to debug my source code without breakpoints from where you want line by line, by the “Run To Cursor” we can save time of debugging, directly we can run from that line which we have to test by debugging and no need to start debugging by visual studio, try it must be use full for every developer, Let’s see how we can use “Run To Cursor”.

Step 1: Open visual studio-> file -> new Project->.

console application

And Write a class MyMath with a function name Sum(int Value1,int Value2) which we have to into Main() and we have to debug that line we no need to use Breakpoints.

cs code

Now right click on that line from we have to start Debugging and go to “Run To Cursor”.

Debugging

And then my output will be shows as the code.

console

Now enter two value and press enter and for next press F11 so we can debug line by line without breakpoints.

breakpoints

Now u can see the output.

output

Hope you will enjoy thanks ☺.

Next Recommended Reading
C# 6.0 with Visual Studio 2014