{"id":1743,"date":"2014-03-07T10:46:00","date_gmt":"2014-03-07T10:46:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2014\/03\/07\/enhancements-to-debugging-exceptions-with-intellitrace-in-visual-studio-2013\/"},"modified":"2022-07-18T02:16:20","modified_gmt":"2022-07-18T10:16:20","slug":"enhancements-to-debugging-exceptions-with-intellitrace-in-visual-studio-2013","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/enhancements-to-debugging-exceptions-with-intellitrace-in-visual-studio-2013\/","title":{"rendered":"Enhancements to Debugging Exceptions with IntelliTrace in Visual Studio 2013"},"content":{"rendered":"<p>The <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2013\/09\/20\/introducing-microsoft-monitoring-agent.aspx\">Microsoft Monitoring Agent<\/a> allows you to collect reliability and <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2013\/09\/20\/performance-details-in-intellitrace.aspx\">performance data<\/a> for web applications and to review the data using IntelliTrace. With Visual Studio 2013 Update 2, we have added the ability to more easily navigate the diagnostics data related to an exception by using a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/dn269218(v=vs.120).aspx\">CodeLens<\/a>-enhanced <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2012\/10\/26\/introducing-code-map-in-visual-studio-2012-update-1-ctp.aspx\">Code Map<\/a> view in combination with the existing IntelliTrace experience.<\/p>\n<p>Today when I start debugging by double clicking an exception from the summary page, on the call stack window I have to double click each stack frame to examine the parameters of the previous stack frame. This makes it tedious searching for parameters while keeping in mind what the exception was that was thrown. To address that, we have combined the information you get from 3 different windows into a one that is easier to use.<\/p>\n<p>Let\u2019s examine that experience in this blog post.<\/p>\n<h2>Summary Page<\/h2>\n<p>For this example, assume that I have collected data using the <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2013\/09\/20\/introducing-microsoft-monitoring-agent.aspx\">Microsoft Monitoring Agent<\/a> for my MVC application that threw an exception. I open up the resulting IntelliTrace file in Visual Studio, open the associated solution from the Open Solutions gold bar and on the summary page I can see the exception that was thrown from the MVC application. Opening the solution is useful so that I can see the CodeLens indicators like history of code changes on the methods that led to the exception. If the solution is not opened IntelliTrace would still show the source files.<\/p>\n<p><img decoding=\"async\" title=\"1\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"1\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/8345.1_thumb_26D2A186.png\" width=\"745\" height=\"402\" \/><\/p>\n<p>I double click on the row with the exception message (or click on the \u201cDebug Newest Exception in Group\u201d) and IntelliTrace starts debugging and now displays a Code Map view of the call stack that led to the exception.<\/p>\n<p><img decoding=\"async\" title=\"2\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"2\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/6710.2_thumb_7B8E0A7E.png\" width=\"902\" height=\"362\" \/><\/p>\n<p>The Code Map window now shows the method that threw the exception. It also contains an annotated comment that describes the exception message. This makes it easier to visualize all the context that led to the exception in one convenient window instead of having to manually navigate between the IntelliTrace events window, call stack window and locals window to make that connection.<\/p>\n<h2>Parameters<\/h2>\n<p>If the methods in the Code Map window contains parameters then a \u2018Parameters\u2019 link is displayed above the method name. When the link is clicked a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/dn269218(v=vs.120).aspx\">CodeLens<\/a> popup window is shown that contains the list of parameters of that method. The benefit of seeing the parameters in the popup window is that I don\u2019t have to switch to the context of that method to see the parameters in the locals window. Hence it makes it easier to view the parameters of different methods from a single Code Map window.<\/p>\n<p><img decoding=\"async\" title=\"3\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"3\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/3240.3_thumb_686C4755.png\" width=\"703\" height=\"333\" \/><\/p>\n<p>The parameter \u2018@id\u2019 with value \u2018121\u2019 corresponds to the code where the InvalidOperationException was thrown.<\/p>\n<p>The Code Lens popup window can be docked by clicking on the <img decoding=\"async\" title=\"clip_image002\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/1106.clip_image002_thumb_614D0ADD.png\" width=\"17\" height=\"15\" \/> icon.<\/p>\n<p><img decoding=\"async\" title=\"4\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"4\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/0118.4_thumb_6F1F50D8.png\" width=\"626\" height=\"196\" \/><\/p>\n<p>The docked Code Lens window makes it easier to compare parameters with the popup window from other methods.<\/p>\n<h2>Show External Code<\/h2>\n<p>To see all the external methods in the Code Map window I can enable the \u2018Show External Code\u2019 option from the right click menu in the call stack window. I can click on the \u2018Parameters\u2019 link on the methods to see more interesting parameters.<\/p>\n<p><img decoding=\"async\" title=\"6\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"6\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/5822.6_thumb_15ED6719.png\" width=\"714\" height=\"651\" \/><\/p>\n<h2>Navigation to source<\/h2>\n<p>I can double click on the method that threw the exception in the Code Map window to navigate to the source \u2013 here is a screenshot of what that may look like:<\/p>\n<p><img decoding=\"async\" title=\"5\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"5\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/6011.5_thumb_03A4A057.png\" width=\"658\" height=\"82\" \/><\/p>\n<h2>Code Map Window<\/h2>\n<p>Please note if the Code Map window \u2018CallStack1.dgml\u2019 is closed then it can be restored back by clicking the \u2018Code Map\u2019 button from the Debugger toolbar.<\/p>\n<p><img decoding=\"async\" title=\"7\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"7\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/03\/4857.7_thumb_63899399.png\" width=\"293\" height=\"27\" \/><\/p>\n<p>I can also select all the methods in the Code Map using the keyboard shortcut \u2018Ctrl+A\u2019 and then press the \u2018Del\u2019 key to clear the graph. This could be useful if I want to start debugging from another exception from the summary page of the same IntelliTrace file or another exception from a different IntelliTrace file and don\u2019t want the stale methods from the previous exception.<\/p>\n<h2>In Closing<\/h2>\n<p>We hope you find the ability to visualize the call stack of the exception and parameters on the methods help understand the context that led to the exception. For feedback on this, or any IntelliTrace feature, please ask us at our <a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/home?forum=vsdebug\">diagnostics MSDN forum<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Microsoft Monitoring Agent allows you to collect reliability and performance data for web applications and to review the data using IntelliTrace. With Visual Studio 2013 Update 2, we have added the ability to more easily navigate the diagnostics data related to an exception by using a CodeLens-enhanced Code Map view in combination with the [&hellip;]<\/p>\n","protected":false},"author":158,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[226,1,225],"tags":[],"class_list":["post-1743","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>The Microsoft Monitoring Agent allows you to collect reliability and performance data for web applications and to review the data using IntelliTrace. With Visual Studio 2013 Update 2, we have added the ability to more easily navigate the diagnostics data related to an exception by using a CodeLens-enhanced Code Map view in combination with the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/158"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=1743"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1743\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=1743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=1743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=1743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}