Visual studio and .NET tip 9:- Conditional Debugging

As a developer you always do debugging debugging is your routine job and you you would like to debug smartly rather than debugging monotonically for example lets have look at this code here its a simple 2 line code the first line takes a input from the console application and pushes it to a string and you then this string data if you have push to other string data and we have put a simple debug point here now irrespective of whatever condition we run this program this debug point will get executed with will always get executed now what we want is we want our debug to x smartly in other words if any body put shiv in the console readline at the time only do the debugging or at the time only the debugger should halt or else the debugger should not halt and that’s where we have something called as conditional debugging so in order to enable conditional debugging right click on the debugging point and you can see that something called as condition here click on condition and over here will say run the str is equal to shiv then only go and halt this debugger and let me do OK now once you do OK you can see that there is small + sign here which is now seen in a debugger on the debug point normally when you put a debug point it’s complete brown but here you can see that it’s brown but that is a + sign inside it which indicates that this is a conditional debugging this is a conditional debug point now let me go and run my program here so thats my console application running now let see if I put x y z then you can see that it has not the debug point has not broken or the debug point did not execute and now if I let say if I go and put shiv here so let me put shiv and if I press enter now you can see that it has gone inside the debug point so in other words until my condition is not met this debug point will not execute or this debug point will not halt so this is termed as conditional debuging many times you want to break depending on the number of times the debugging point was it so for those kind of situation what you can do is you can use something called as the brack hit count so you can see over here that is something called as hit count condition so you can see that OK when this line of code is executed greater than 2 greater than or equal to 2 or 3 I will say please go and then only halt the debugger so in case you want to what you call fall the debugger depending on the number of time the code has executed then you can always use this break hit count so in this way why conditional debugging you can debug smartly you can debug effectively and that will also improve your productivity I hope that you have enjoy this tip in this tip we saw how that we can use conditional debugging to make our debugger to x smartly now what ever video you have seen is just a glimpse of what we have done so in case you are interested in our video package you can go to our site that is www.questpond.com you can call on this number +919967590707 and you can ask the complete DVD package what we have so in this DVD package what we have done is basically we have covered almost everything what a .Net developer wants so right from basics of ASP.NET object oriented programing SQL Server to new technology like WCF silverlight LinQ Azure Entity Framework we also have UML Architecture, Estimation, Project Management that is completely invoicing project end to end which is covered so that you can get a better feel of how to actually create projects in a systematic manner we have covered server product both for sharepoint 2007 as well as for 2010 we have lot of this practice’s video on SQL Server etc so this complete package you can get from www.questpond.com if I interested and you can call on this number +919967590707 and you can asked for the rate it’s very descent rate what we have in the same way as compare to the videos we also have one more product with us that is our Interview question books so we have different kind of interview question books right from Dot net interview questions to SQL Server interview questions sharepoint interview questions Biztalk interview questions etc so in case you are interested in the books part you can call on these numbers as per your location so you can see this number on the board at this moment so I hope that you keep enjoying the videos you keep seen our site and I hope that you gain that more knowledge Thank You Very Much …..

Tags: , , , , , , , , , , , , ,


Leave a Reply

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