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.
Must read:
You will see Visual Studio begin executing your application and it will stop at the line you selected.
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.