Pin features while debugging in Visual Studio 2010.
Join the DZone community and get the full member experience.
Join For FreeVisual Studio 2010 is one of most awesome tools used to debug Microsoft.NET
related code. I have found one more interesting feature with the Visual
studio 2010m, the Pin Data Tip feature. This feature can be
very useful when you are debugging code with loops. Normally, when
you debug the code, you have to put your curser on the variable if you want know the value of that variable. Then, the tool tip will show the values of that variable. The pin feature will pin that tool tip and you
don’t have to put mouse over it again. Let’s take a simple example to
examine the feature further. Code for the example is shown below. I have created a
simple for loop and I am printing a variable value with Response. Write on the
asp.net page.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Blogging { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { for (int i = 1; i <= 20; i++) { Response.Write(i.ToString()); } } } }
Now let’s put the break point on for loop as follows, and then start debugging by pressing F5.
Now as you can see there is one Icon in above code so once you click on that pin Icon that it will pin the DataTip for that variable like following.
So now whatever you debug in that loop you can see the the value of variable I at any time like following.
So, that’s it. Life is easy thanks to the new debugging features in Visual Studio 2010. Hope you enjoyed the tutorial! Stay tuned for more. Happy Programming!
Published at DZone with permission of Jalpesh Vadgama, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
File Upload Security and Malware Protection
-
Real-Time Presence Platform System Design
-
AI Technology Is Drastically Disrupting the Background Screening Industry
-
Enriching Kafka Applications With Contextual Data
Comments