{"id":14422,"date":"2016-03-31T22:05:43","date_gmt":"2016-03-31T22:05:43","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/?p=14422"},"modified":"2020-03-05T06:05:58","modified_gmt":"2020-03-05T14:05:58","slug":"using-the-new-exception-helper-in-visual-studio-15-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/using-the-new-exception-helper-in-visual-studio-15-preview\/","title":{"rendered":"Using the New Exception Helper in Visual Studio 2017"},"content":{"rendered":"<p>Dealing with exceptions is a common developer problem no matter your technology or level of expertise. It can be a frustrating experience figuring out why exceptions are causing problems in your code. When you are debugging an exception in Visual Studio, we want to lessen that frustration by providing you with relevant exception information to help you debug your issue faster. So in\u00a0Visual Studio 2017\u00a0we are introducing the simplified, non-modal, new Exception Helper.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/ExceptionHelperPreview1.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"ExceptionHelperPreview1\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/ExceptionHelperPreview1_thumb.png\" alt=\"ExceptionHelperPreview1\" width=\"683\" height=\"291\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/help2.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"help2\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/help2_thumb.png\" alt=\"help2\" width=\"666\" height=\"242\" border=\"0\" \/><\/a><\/p>\n<p>In previous versions of Visual Studio, when you break on an exception, you will see the Exception Assistant (when debugging managed code), or the Exception Dialog (when debugging Native code, or if you disabled the Exception Assistant).<\/p>\n<p>Exception Assistant:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/help3.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"help3\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/help3_thumb.png\" alt=\"help3\" width=\"559\" height=\"392\" border=\"0\" \/><\/a><\/p>\n<p>Exception Dialog:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/help4.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"help4\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/help4_thumb.png\" alt=\"help4\" width=\"531\" height=\"348\" border=\"0\" \/><\/a><\/p>\n<p>We looked closely at both of these dialogs, listened to your feedback on <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-2015\/suggestions\/5403561-improve-usability-of-the-exception-dialog\">User Voice<\/a> and from Send-A-Smile, and decided they needed an overhaul.<\/p>\n<h2>Highlights of the New Exception Helper<\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><b>Breaking on the Line of Code<\/b> &#8211; No matter if you are managed or native debugging, when you break on an exception the debugger will stop you on the line of code where that exception happens. An exception error icon will appear to the right of that line of code and the non-modal, smaller, less distracting Exception helper will pop down from that icon and stay pinned to that code line.<\/li>\n<li><b>Exception Information at a Glance <\/b>\u2013 You will instantly be able to read the exception type and exception message in the Exception Helper, and whether the exception was thrown or unhandled.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a name=\"nullrefs\"><\/a><\/p>\n<ul>\n<li><strong>Null Reference Analysis\u00a0\u2013 <\/strong>Starting in VS 2017 , for both managed and native code, when you hit a NullReferenceException or an Access Violation, you will see null analysis information in the\u00a0Exception Helper. If we cannot determine\u00a0what is null we will not\u00a0attempt to show any analysis. When we can detect what is\u00a0null we will emphasize the\u00a0culprit in bold text.\u00a0<a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/10\/29\/improvement-to-debugging-c-access-violations-in-visual-studio-2015-update-1\/\">For C++ Access Violations, this analysis will be present in Visual Studio 2015<\/a> as well.<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/DividebyZeroException.png\">\n<\/a><img decoding=\"async\" class=\"wp-image-28605 alignnone\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/ExceptionHelper0.png\" alt=\"exceptionhelper0\" width=\"589\" height=\"354\" \/>\nNote: Null reference analysis in managed code requires <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-framework-4-6-2\/\">.NET version 4.6.2<\/a>.\u00a0Null\u00a0analysis\u00a0is currently not supported for Universal Windows Platform (UWP) and any other .NET Core applications. It is only available while debugging code that does not have any <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms241594.aspx\">Just-In-Time (JIT)<\/a> code optimizations.<\/li>\n<li><strong>Configure your Exception Settings \u2013 <\/strong>When you break on Exception Thrown\u00a0you can use the checkbox under Exception Settings in the Exception Helper to disable breaking on that exception type\u00a0when thrown in the future. You can also specify\u00a0that you do not want to break on\u00a0this particular\u00a0exception thrown in this particular module by checking the box by the module name under &#8220;Except when thrown from:&#8221; in the Exception Settings. You can apply conditions to your exceptions to <a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2016\/03\/31\/break-on-exceptions-thrown-only-from-specific-modules-in-visual-studio-15-preview\/\">only break when thrown from certain modules<\/a>.<\/li>\n<li><b>Inner Exceptions right away <\/b>\u2013 No longer will you have to drill into the exception details to see if there is an inner exception. We show it to you right when you break with the ability to navigate back through multiple inner exceptions.\n<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/InnerException.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"InnerException\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/InnerException_thumb.png\" alt=\"InnerException\" width=\"360\" height=\"276\" border=\"0\" \/><\/a><\/li>\n<li><b>Move it where you need it <\/b>\u2013 You can drag the Exception Helper from its pinned view to its floating view if it happens to cover up something you need to look at, or you want to view it while switching code files. You can also use the pin icon to float it, or snap it back to the line of code. If you close the Exception Helper, simply click on the exception error indicator to bring it back up.<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/help8.png\">\n<img decoding=\"async\" class=\"alignleft\" style=\"float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; padding-right: 0px; margin-right: auto; border-width: 0px;\" title=\"help8\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/help8_thumb.png\" alt=\"help8\" width=\"295\" height=\"105\" border=\"0\" \/><\/a><\/li>\n<li><b>Faster breaking for Unhandled Exceptions <\/b>\u2013 When managed debugging, the debugger will no longer automatically unwind the Call Stack when you break on an unhandled exception. This means that you will break into your code faster because the debugger doesn\u2019t need to walk the Call Stack before breaking.<\/li>\n<li><b>Non-Modal \u2013 <\/b>When native debugging, you will no longer need to dismiss an exception dialog to inspect your code. The new Exception Helper is available right inline next to your code.<\/li>\n<\/ul>\n<p>If you need to turn off the Exception Helper go to Debug\/Options, scroll down\u00a0the list and un-check the box for \u201cUse the Exception Helper\u201d. Then use the report a problem feature of Visual Studio to let us know why the Exception Helper wasn\u2019t working for you.<\/p>\n<h2>Wrap Up<\/h2>\n<p>Download Visual Studio 2017\u00a0today, use the new Exception Helper, and send us feedback about the experience. We hope you find this it useful and let us know if you have any questions in the comments section below, using the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/b8akas30.aspx\">Send Feedback feature in Visual Studio<\/a>, or via <a href=\"https:\/\/twitter.com\/vs_debugger\">Twitter<\/a>.<\/p>\n<p>Sign up to help us improve the Visual Studio Debugger: <a href=\"https:\/\/aka.ms\/debuggerfb\">aka.ms\/debuggerfb<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dealing with exceptions is a common developer problem no matter your technology or level of expertise. It can be a frustrating experience figuring out why exceptions are causing problems in your code. When you are debugging an exception in Visual Studio, we want to lessen that frustration by providing you with relevant exception information to [&hellip;]<\/p>\n","protected":false},"author":181,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-14422","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>Dealing with exceptions is a common developer problem no matter your technology or level of expertise. It can be a frustrating experience figuring out why exceptions are causing problems in your code. When you are debugging an exception in Visual Studio, we want to lessen that frustration by providing you with relevant exception information to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/14422","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\/181"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=14422"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/14422\/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=14422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=14422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=14422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}