{"id":7561,"date":"2016-02-12T22:10:26","date_gmt":"2016-02-12T22:10:26","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=7561"},"modified":"2019-02-18T18:04:50","modified_gmt":"2019-02-18T18:04:50","slug":"natvis-for-ccli-available-in-vs2015","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/natvis-for-ccli-available-in-vs2015\/","title":{"rendered":"Natvis for C++\/CLI Available in VS2015"},"content":{"rendered":"<p><em>This post\u00a0details how to enable the feature in VS2015 Update 2. \u00a0The recommended way of getting this feature is now to <a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs2015-update3-vs\">install VS2015 Update 3<\/a> which supports it\u00a0by default.<\/em>\nIn Visual Studio 2012 the native debugger significantly improved with the addition of native visualizers (<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/jj620914.aspx\">natvis<\/a>) as part of a major debug engine overhaul. \u00a0Adding C++\/CLI code to your project would trigger the debugger to use our old debugging infrastructure as the new debugging infrastructure lacked support for C++\/CLI.\u00a0 We\u2019ve heard your feedback and we\u2019re happy to announce the first preview of the new debugging experience in Update 2 that can be enabled as\u00a0described below.\nHere is an example of how the debugging experience has improved for a managed object containing a native object with a std::vector&lt;std::basic_string&gt; as a member, first showing the pre-existing experience for context and then the much improved experience in Update 2.\n<strong>Visual Studio 2015 Update 1 and earlier<\/strong>\n<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/oldwatch1.png\"><img decoding=\"async\" class=\"alignnone wp-image-7601 size-full\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/oldwatch1.png\" alt=\"oldwatch\" width=\"952\" height=\"199\" \/><\/a>\nNotice that expanding a managed object containing a native object leads to a very poor experience: <em>std<\/em> visualizers are ignored and container members are not expanding as they would in pure native application.\u00a0 This is a severe limitation since it prevents easy linear viewing of any container elements and viewing meaningful data values requires multiple expansions.\u00a0 The vector object below is expanded multiple times and still shows no elements, values, or even the size of the container.\n<strong>Visual Studio 2015 Update 2 (after enabling in registry)<\/strong>\n<img decoding=\"async\" class=\"alignnone wp-image-7591 size-full\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/newwatch1.png\" alt=\"newwatch\" width=\"941\" height=\"237\" \/>\nNow the same variables in the watch window will show the proper container and member expansions as defined in the natvis visualizers. \u00a0The <em>std::vector<\/em>\u00a0correctly shows its member expansions and inspecting the objects feels natural just like with pure native code, listing the size, capacity, and each element&#8217;s value.\n&nbsp;<\/p>\n<h2>How to Try It Out<\/h2>\n<p><em>Note: we now recommend upgrading to <a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs2015-update3-vs\">VS2015 Update 3 <\/a>a this release supports the new EE by default and has bug fixes related to this feature.<\/em>\nWe are hoping to get as much feedback as possible from C++\/CLI users to make sure this improved debugging experience meets your needs.\u00a0 We\u2019d love for you try kick the tires on this greatly improved debugging experience and let us know how it\u2019s working for you!\nDue to a bug in the Update 2 RTM release, you first must download and install the micro-update KB3151378 found here:\n<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/mt695655.aspx\">https:\/\/msdn.microsoft.com\/en-us\/library\/mt695655.aspx<\/a>\nOnce the micro-update is installed, we have moved all of the fixes into a .vsix that can enable the new EE just by installing the extension:\u00a0<a href=\"https:\/\/visualstudiogallery.msdn.microsoft.com\/ab846c83-56be-41b4-88e7-95895ab528dc\">https:\/\/visualstudiogallery.msdn.microsoft.com\/ab846c83-56be-41b4-88e7-95895ab528dc<\/a>\nThe reg key mentioned in the earlier version of this post is no longer valid. \u00a0We plan to have this feature on by default for Visual Studio 2015 Update 3.<\/p>\n<h2>Closing Remarks<\/h2>\n<p>We look forward to having this as the default experience in the future and would love to hear your feedback.\u00a0 Please leave comments or feel free to shoot me an email: <a href=\"mailto:vsdbgfb@microsoft.com\">vsdbgfb@microsoft.com<\/a> if you run into any issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post\u00a0details how to enable the feature in VS2015 Update 2. \u00a0The recommended way of getting this feature is now to install VS2015 Update 3 which supports it\u00a0by default. In Visual Studio 2012 the native debugger significantly improved with the addition of native visualizers (natvis) as part of a major debug engine overhaul. \u00a0Adding C++\/CLI [&hellip;]<\/p>\n","protected":false},"author":295,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>This post\u00a0details how to enable the feature in VS2015 Update 2. \u00a0The recommended way of getting this feature is now to install VS2015 Update 3 which supports it\u00a0by default. In Visual Studio 2012 the native debugger significantly improved with the addition of native visualizers (natvis) as part of a major debug engine overhaul. \u00a0Adding C++\/CLI [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/7561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/295"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=7561"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/7561\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=7561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=7561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=7561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}