Introduction
As a developer, we normally spend 60 percent of our time debugging applications. Debugging in Visual Studio deals with breakpoints. Good knowledge of breakpoints is definitely going to be a boon. It will save time as well as make debugging lot more easier.
How to add a break point?
Budding developers!!! It's the first question that's going to come to your mind. There are primarily two ways to add a breakpoint to any line.
- click on the left hand side of the line, you want to have a debugger
- click F9, putting the cursor on the targeted line
How to check all the break points present in the application ?
There is a window called Breakpoints window and after opening that you can see all the breakpoints in the application.
To open the breakpoints window:
- Go to menu Bar > Debug > Windows > Breakpoints click
- Or press Ctrl+Alt+B
After clicking this, the Breakpoint window will open at the bottom panel of Visual Studio.
This window shows all the breakpoints present in the application. It will show the disabled breakpoints also.
Features of Breakpoint window
Following diagram explains all the features present in Breakpoint window
- Using the "New" button user can create a new Breakpoint, which will be visible in the same window also.
- Using the "Delete" button user can delete a single breakpoint at a time. By clicking on this it will remove the breakpoint from the code also.
- Using "Delete All" user will be able to delete all the breakpoints matching the search criteria.
- Using "Disable All" user will be able to disable all the breakpoints matching the search criteria. Disabled breakpoints wont be removed from the window or code. It can be easily tracked in the Breakpoint window.
- Using "Export" button user will be able to export the breakpoint to a XML file. This can be shared accross through mail and the other users will also be able to use breakpoints at the same lines.
- Using "Import" button user will be able to import the breakpoints shared by other user. It will enable or disable the breakpoints at the same positions.
- On clicking of "Go to Source code" button it will take the focus/cursor to the line in the code where the breakpoint is present. Same thing can be achived by double clicking on the breakpoint in the breakpoint window.
- Combition of "Search" and "In Column" result in filtering the records in Breakpoint window.
- Using "Reset Search Criteria" button all the searched value can be brought back to initial state. i.e no search filters will be applied on the records in the Breakpoint window.
Glance of Part 2
Part 2 of this breakpoints series will be mainly focused on Breakpoint settings. It will cover conditions settings and actions settings in depth. So just hang on !!
Conclusion
Using Breakpoint window to its full potential will definitely help save time during development. I personally love the import and export options. When helping your friend in finding a solution for an issue this will come really handy.
I hope you will be able to use Breakpoint to its fullest potential and get the best results out of it.
Happy coding!!