{"id":137,"date":"2009-12-25T21:31:00","date_gmt":"2009-12-25T16:01:00","guid":{"rendered":"https:\/\/ashokaon.tech\/blog\/?p=137"},"modified":"2020-07-18T01:49:31","modified_gmt":"2020-07-17T20:19:31","slug":"visual-studio-2010-new-features-in-debugging","status":"publish","type":"post","link":"https:\/\/ashokaon.tech\/blog\/visual-studio-2010-new-features-in-debugging\/","title":{"rendered":"Visual Studio 2010 New Features in Debugging \u2013 Exciting &#038; Innovative"},"content":{"rendered":"<p><span style=\"font-size: 10px;background-color:#FFFF99;display:block\">(Note: This blog post was originally published under my old domain(codesmiles.com), <a href=\"http:\/\/codesmiles.com\/post\/Visual-Studio-2010-New-Features-in-Debugging.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. <a href=\"https:\/\/web.archive.org\/web\/2010*\/http:\/\/www.codehappiness.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Web Archive link<\/a>.<\/span><\/p>\n<p style=\"color: #777; font-size: 11px\">(This post is part of my <a href=\"http:\/\/www.codesmiles.com\/post\/visual-studio-2010-new-features.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Studio 2010 series<\/a>)<\/p>\n<p>This article talks about Visual Studio 2010\u2019s new features related to debugging, applicable from beginner to expert(based on Visual Studio 2010 beta 2). Visual Studio 2010 comes with powerful debugging features. Debugging is an area where an improvement brings great relief to developers, and increases developer happiness. Visual Studio 2010 seems to highly enhance debugging support, and can change some basic ways we used to debug applications, let us have a look.[more]<\/p>\n<h2>Export\/Import Breakpoints<\/h2>\n<p>By using Export\/Import breakpoints in Visual Studio 2010, you can debug a portion of the application and export the current set of breakpoints and import it back whenever you want to debug the same portion of application, no matter what breakpoints you have currently placed in your code. This feature will enable you to have different set of breakpoints for each scenario or portion of application that you may need to debug. This is one of the features that I highly wished to have.<\/p>\n<p><strong>An example scenario\u2026<\/strong> consider your web page\/windows form has basic <a href=\"http:\/\/en.wikipedia.org\/wiki\/Create,_read,_update_and_delete\" target=\"_blank\" rel=\"noopener noreferrer\">CRUD<\/a>(Create\/Read\/Update\/Del) options, you are currently working on \u201cCreate\u201d part. When executing if you get unexpected results, you will set up several breakpoints and debug, then you proceed to code \u201cUpdate\u201d part.<\/p>\n<p>Now, when you need to debug \u201cUpdate\u201d part you mostly clear\/disable all breakpoints you just set and create new breakpoints. But what if you get some new error in Create part again? you have to clear\/disable all break points, and again go to different locations, set breakpoints and debug the Create part.<\/p>\n<p>This example is not complex, but think of all those complex scenarios you may have debugged for hours; switching one scenario to another.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px;         border-left-width: 0px\" title=\"How to Export &amp; Import Breakpoints in Visual Studio 2010\" src=\"\/blog\/wp-content\/uploads\/Visual-Studio-2010-New-Features-in-Debugging--Export-Import-Breakpoints.png\" border=\"0\" alt=\"Visual Studio 2010 new features in debugging - how to Export and Import Breakpoints\" width=\"560\" height=\"523\"><\/p>\n<p>Choose <strong>Debug-&gt;Windows-&gt;Breakpoints<\/strong> and Export\/Import breakpoints as indicated above. Breakpoints will be exported as a file in the location you choose and you can select this file when you import.<\/p>\n<h2>Stick the DataTips<\/h2>\n<p>You know that, while debugging, we can hover our mouse over a variable\/object and inspect, edit &amp; explore it and we call this as DataTip. In Visual Studio 2010, we can stick DataTips to our code window and drag &amp; drop to any location and the DataTip will hang there. This new feature gives pretty easy view to monitor the variables that matters for your current debugging.<\/p>\n<p><strong>Pin, Unpin(delete), add comment<\/strong><\/p>\n<p>You can click the pin icon next to a variable\u2019s DataTip and it will stick to your code window for you to drag &amp; place as you like.<\/p>\n<p>You can remove it by clicking the &#8220;X&#8221; in the DataTip mouse hover menu.<\/p>\n<p>You can add comments\/notes for a variable by clicking the double down arrow in the DataTip hover menu.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px;         border-left-width: 0px\" title=\"How to use DataTips in Visual Studio 2010\" src=\"\/blog\/wp-content\/uploads\/Visual-Studio-2010-new-features-in-debugging--How-to-use-DataTips.png\" border=\"0\" alt=\"How to use DataTips in Visual Studio 2010\" width=\"604\" height=\"457\"><\/p>\n<p><strong>Unpin from a single source and make it available in all source files<\/strong><\/p>\n<p>By default the DataTip will be pinned to current source file, if you want the variable\/object on other source files too (in page1.aspx.cs, page2.aspx.cs, etc) then you can click the unpin icon in datatip hover menu. You may do this for global objects.<\/p>\n<h2>Export\/Import DataTips<\/h2>\n<p>As I explained in Export\/Import Breakpoints, we can export\/import DataTips too, in the same way in Visual Studio 2010.<\/p>\n<p><strong>More on Datatips\u2026<\/strong><br \/>\nIf you pin(stick) the elements of same array(a[1],a[4]) it is automatically placed as a group.<\/p>\n<p style=\"font-size: 11px;\"><span style=\"color: #f00\">Update:<\/span> Just noted that there is no mention about Intellitrace feature(historical debugging) in this post, I didn\u2019t include this previously because of few reasons.<\/p>\n<h2>Intellitrace (Historical Debugging)<\/h2>\n<p>IntelliTrace is a feature previously known as Historical debugging, which is a major enhancement made to the Visual Studio 2010 debugger. When an exception occurs, you usually start debugging with breakpoints set in suspected areas and check variable\/object values for correctness.<\/p>\n<p>But if an exception occurs when IntelliTrace is enabled, it allows you to just go back in time of your application execution and find out what events got raised and what were the values of various variables, etc similar to Call stack like approach. This helps you inspect all the events that finally triggered the exception. This helps in many ways, even you don\u2019t need to worry about breakpoints.<\/p>\n<p><strong>Update:<\/strong> I have written an article on IntelliTrace <a href=\"http:\/\/www.codesmiles.com\/post\/intellitrace-in-visual-studio-2010.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Conclusion:<\/h2>\n<p>I am sure these new features of Visual studio 2010 would have excited you as it did to me. These tools help speed up debugging. I take this opportunity to encourage you to highly utilize these wonderful changes that are going to be available in Visual Studio 2010. (Update: Visual Studio 2010 final product is released on April 12, 2010).<\/p>\n<p><strong>Please Note:<\/strong><\/p>\n<p>This article discusses about only Visual Studio 2010\u2019s new features that will get immediately noticed by majority of the developers, and features that will be used by all kinds of developers using Visual Studio, hence I ignored some options related to specific category of developers or options that are advanced, or minor differences that might <em>Not<\/em> get noticed as \u201cnew features\u201d, things I didn\u2019t cover includes \u2013 parallel computing, new menu\/context-menu options, etc. The article keeps beginners and Non-native English readers too in mind.<\/p>\n<p style=\"font-size: 11px\">Also, as I have posted this blog entry as article in <a rel=\"tag\" href=\"http:\/\/www.codeproject.com\">CodeProject<\/a> too, you may notice style difference.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. (This post is part of my Visual Studio 2010 series) This article talks about Visual Studio 2010\u2019s new features related to debugging, applicable from beginner to expert(based on Visual Studio 2010 beta 2). Visual Studio<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[34,13],"_links":{"self":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":5,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":326,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions\/326"}],"wp:attachment":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}