This article explains the function breakpoints in Visual Studio.
Previously we discussed the concept of Hit Count breakpoints and Conditional breakpoints. We will now explain function breakpoints. This functionality allows us to set the name of a function as the condition for the breakpoint to hit.Let's start by creating 2 functions, SetString() and GetString(), and call them as SetString() first and then GetString().Figure 1: Breakpoint FunctionTo set the breakpoints for this type, go to Debug, then Windows and select Breakpoints to open the Breakpoints window. Select the option New, then the Break at Function option from the window.Figure 2: Break at FunctionThis opens up a new window and we specify the name of the GetString() function as the function condition for the breakpoint to be hit.Figure 3: New breakpointHover over the breakpoint and we can see its details.Figure 4: Tips Tricks FunctionRun the application and the breakpoint will be hit only when the execution of the GetString() function starts.Figure 5: Run ApplicationEasy and helpful, isn't it? Happy coding!
Printing in C# Made Easy