In this post we’ll learn “How to use “Run to Cursor” while debugging”. Run to cursor is a nice, hidden feature of Visual Studio. It can really increase your productivity while debugging any application in Visual Studio. You can actually avoid step-by-step debugging and directly stop the debugger where you want it to stop. “Run to cursor” is like another breakpoint, but in this case, you don’t need to start the Visual Studio debugger manually and the breakpoints clear when pressed.

When you select the Run to cursor option, Visual Studio automatically starts the debugger and execution stops at the selected line. Right-click on the line where you want to stop the debugger, you will get the “Run to cursor” option in the context menu; Choose it.

How to use “Run to Cursor” while debugging in Visual Studio

Must read:



You will see Visual Studio begin executing your application and it will stop at the line you selected.

How to use “Run to Cursor” while debugging in Visual Studio

From here you can continue debugging as desired. In general, as the name suggests, “Run to cursor” keeps the debugger at the point you mentioned.

You can achieve this by using “CTRL + F10” shortcut key.

This feature is mainly used when you are debugging a repeating code path or a module that is called multiple times.

I hope above will help. You can check more articles on our website under C# section HERE or you can also check same on Microsoft Docs too.

Leave a Reply

Your email address will not be published. Required fields are marked *

Explore More

Working With File Class In C#

In C#, ‘File’ class provides many static methods for moving, copying, and deleting files. These Static methods involve moving a file and copying and deleting a file also. Let’s check

How to Read a Text File in C#

In C# ‘File’ class provides static methods to read given text file data. The File.ReadAllText() method opens a text file, reads all the text present in the file into a

C# | How to use Interface references

In C#, you’re permitted to make a reference variable of an interface type or in other words, you’re permitted to form an interface reference variable. Such kind of variable can