{"id":1853,"date":"2014-02-12T09:29:00","date_gmt":"2014-02-12T09:29:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2014\/02\/12\/intellitrace-mvc-navigation\/"},"modified":"2022-07-18T02:53:58","modified_gmt":"2022-07-18T10:53:58","slug":"intellitrace-mvc-navigation","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/intellitrace-mvc-navigation\/","title":{"rendered":"IntelliTrace MVC Navigation"},"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. For Microsoft Visual Studio 2013 Ultimate, Update 2, we have added the ability to easily navigate to Actions and Controllers for Model View Controller (MVC) web sites. 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. I open up the resulting IntelliTrace file in Visual Studio, open the associated solution and on the summary page I can see some performance violations (BTW, we now have <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/02\/11\/ui-enhancements-for-intellitrace-with-visual-studio-2013-update-2.aspx\">grouping for events<\/a> as you can see).<\/p>\n<p><img decoding=\"async\" style=\"border-width: 0px\" title=\"Performance Violations\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/6746.performance_violation_thumb_1B8AC4DB.png\" alt=\"Performance Violations\" width=\"642\" height=\"162\" border=\"0\" \/><\/p>\n<p>I double-click on the first row to investigate the newest event in the group.<\/p>\n<h2>Details Page<\/h2>\n<p>The details page for the event shows the slowest <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/02\/11\/ui-enhancements-for-intellitrace-with-visual-studio-2013-update-2.aspx\">Hot Path<\/a> for the event. In this case we can see the HomeController.Index() method is slow.<\/p>\n<p><img decoding=\"async\" style=\"border: 0px\" title=\"Performance Details Page\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/0211.details_page_thumb_223DCE5E.png\" alt=\"Performance Details Page\" width=\"640\" height=\"321\" border=\"0\" \/><\/p>\n<p>I might choose to \u2018Debug This Call\u2019, but instead let\u2019s explore the new MVC-specific functionality in VS2013 Update 2, by expanding the first row \u2013 we see that next.<\/p>\n<h2>Exploring MVC Actions and Controllers<\/h2>\n<p>When we expand the \u2018MVC page : Home Index\u2019 row we see links for the action (\u2018Index\u2019) and the controller (\u2018Home\u2019). Clicking on the \u2018Index\u2019 hyperlink shows all the action methods named \u2018Index\u2019 (or tagged with the ActionNameAttribute \u2018Index\u2019) in the current solution that are in classes named \u2018HomeController\u2019, which also inherit from the MVC Controller class as per the following screenshot.<\/p>\n<p><img decoding=\"async\" style=\"border: 0px\" title=\"Actions Selection\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/4024.action_selection_thumb_490BE49E.png\" alt=\"Actions Selection\" width=\"642\" height=\"135\" border=\"0\" \/><\/p>\n<p>In the screenshot example above, I hovered over one of the actions to also see a source code preview.<\/p>\n<p>I can also click on the \u2018Home\u2019 controllers link and see the list of controllers call \u2018HomeController\u2019, that inherit from MVC \u2018Controller\u2019. In this example, I have 3 controllers and I hover over one to see a source code preview.<\/p>\n<p><img decoding=\"async\" style=\"border: 0px\" title=\"Controller Selection\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/4846.controller_selection_thumb_6FD9FADE.png\" alt=\"Controller Selection\" width=\"642\" height=\"121\" border=\"0\" \/><\/p>\n<p>While seeing this data is cool, at some point I will want to pick one and go to source \u2013 let\u2019s look at that next.<\/p>\n<h2>Navigation to source<\/h2>\n<p>From either list, I can double-click to navigate to source. For example, double-clicking on the \u2018Index\u2019 action takes me here:<\/p>\n<p><img decoding=\"async\" style=\"border: 0px\" title=\"navigate to source\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/3858.navigate_to_source_thumb_68BABE66.png\" alt=\"navigate to source\" width=\"642\" height=\"265\" border=\"0\" \/><\/p>\n<p>If you don\u2019t have the solution open, clicking on actions or controllers will show the following:<\/p>\n<p><img decoding=\"async\" style=\"border: 0px\" title=\"no solution found\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/1715.no_solution_cropped_thumb_768D0461.png\" alt=\"no solution found\" width=\"312\" height=\"81\" border=\"0\" \/><\/p>\n<p>You just need to open a solution to fix this issue.<\/p>\n<p>Also if you haven\u2019t built your solution, a warning may show and your results may not be complete, as shown below \u2013 you can fix that by building your solution.<\/p>\n<p><img decoding=\"async\" style=\"border: 0px\" title=\"no controllers found\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/02\/4442.no_controllers_found_cropped_thumb_6F6DC7E9.png\" alt=\"no controllers found\" width=\"464\" height=\"96\" border=\"0\" \/>\u00a0<\/p>\n<h2>Prerequisites: Source, but not necessarily symbols<\/h2>\n<p>Note that these code navigation scenarios work even if the solution you have open when the itrace file is opened does not exactly match what is deployed. This is in contrast to typical debugging source code navigation, where symbols (PDB files) are required in order to navigate to source. If you want to be sure that code you are viewing does exactly match the deployed code, you may use \u2018debug this call\u2019 for a given row on the Performance Details page.<\/p>\n<h2>In Closing<\/h2>\n<p>We hope you find the ability to quickly and easily navigate to MVC controllers and actions from IntelliTrace performance events useful. 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. For Microsoft Visual Studio 2013 Ultimate, Update 2, we have added the ability to easily navigate to Actions and Controllers for Model View Controller (MVC) web sites. Let\u2019s examine that experience in this [&hellip;]<\/p>\n","protected":false},"author":159,"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-1853","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. For Microsoft Visual Studio 2013 Ultimate, Update 2, we have added the ability to easily navigate to Actions and Controllers for Model View Controller (MVC) web sites. Let\u2019s examine that experience in this [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1853","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\/159"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=1853"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1853\/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=1853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=1853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=1853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}