
Visual Studio is a great IDE for developing all types of Microsoft desktop/web stack applications. There is no doubt about that! One of the main features provided in Visual Studio is its capability to provide more options to debugging the applications. In this post I explain some basic concepts about debugging in Visual Studio.
You can also check my other Visual Studio Tips here.
Setup the environment
In this post I’m using Visual Studio 2015 Community edition. Based on your version of Visual studio some options may differ. For simple and neat explanation, here I’m going to use a simple for loop C# code snippet.
So What is breakpoint?
When you run the program in Visual Studio IDE, if you want to check the execution of a particular routine or function at that time you can set the breakpoint. Probably, it's set before to run the application. So when the program executes, the breakpoint hits and the program waits there. So that you can step into the program and take a deep look into the code and check the values there itself. This is the main advantage of breakpoints.
Set normal Breakpoint
Setting the breakpoint in an application is very simple. You can hit the F9 key or you can click on the left most border in Visual Studio. It will keep the breakpoint on the particular line.
After setting the breakpoint, Visual Studio indicates the particular line with the Red color preceded with a dot like below.

In these kind of breakpoints, it will hit without any conditions. So whenever, the execution crosses the line it will simply hit there.
Set Conditional Breakpoint
So as we discussed in the previous section, say for example, if we set the break point with in a loop, it will hit the break point without any condition. So the breakpoint is hit often. Instead of this, we may want to set some conditions. Let’s see how we can do it.
Setup the environment
In this post I’m using Visual Studio 2015 Community edition. Based on your version of Visual studio some options may differ. For simple and neat explanation, here I’m going to use a simple for loop C# code snippet.
So What is breakpoint?
When you run the program in Visual Studio IDE, if you want to check the execution of a particular routine or function at that time you can set the breakpoint. Probably, it's set before to run the application. So when the program executes, the breakpoint hits and the program waits there. So that you can step into the program and take a deep look into the code and check the values there itself. This is the main advantage of breakpoints.
Set normal Breakpoint
Setting the breakpoint in an application is very simple. You can hit the F9 key or you can click on the left most border in Visual Studio. It will keep the breakpoint on the particular line.
After setting the breakpoint, Visual Studio indicates the particular line with the Red color preceded with a dot like below.

In these kind of breakpoints, it will hit without any conditions. So whenever, the execution crosses the line it will simply hit there.
Set Conditional Breakpoint
So as we discussed in the previous section, say for example, if we set the break point with in a loop, it will hit the break point without any condition. So the breakpoint is hit often. Instead of this, we may want to set some conditions. Let’s see how we can do it.





SubashPosted Jul 14, 2016, 6:12 AM
Very nice francis
Bhuvanesh MohankumarPosted May 3, 2016, 12:56 PM
Good one..
Asfend YarPosted Mar 7, 2016, 12:04 PM
nice
kalu singh raoPosted Mar 7, 2016, 10:32 AM
Nice...
Sibeesh VenuPosted Mar 7, 2016, 7:29 AM
Nice Share
Vignesh ManiPosted Mar 7, 2016, 6:04 AM
Nice share
Mohammed IbrahimPosted Mar 7, 2016, 4:11 AM
nice
Sonu ChaudharyPosted Mar 7, 2016, 1:17 AM
good one