{"id":19115,"date":"2018-09-26T08:00:52","date_gmt":"2018-09-26T15:00:52","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/?p=19115"},"modified":"2019-02-14T15:23:32","modified_gmt":"2019-02-14T23:23:32","slug":"how-to-upgrade-extensions-to-support-visual-studio-2019","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/how-to-upgrade-extensions-to-support-visual-studio-2019\/","title":{"rendered":"How to upgrade extensions to support Visual Studio 2019"},"content":{"rendered":"<p>Recently, I\u2019ve updated over 30 of my extensions to support Visual Studio 2019 (16.0). To make sure they work, I got my hands on a very early internal build of VS 2019 to test with (working on the Visual Studio team has its benefits). This upgrade process is one of the easiest I\u2019ve ever experienced.<\/p>\n<p>I wanted to share my steps with you to show just how easy it is so you\u2019ll know what to do once Visual Studio 2019 is released.<\/p>\n<h2>Updates to .vsixmanifest<\/h2>\n<p>We need to make a couple of updates to the .vsixmanifest file. First, we must update the supported VS version range.<\/p>\n<h4>&lt;InstallationTarget&gt;<\/h4>\n<p>Here\u2019s a version that support every major and minor versions of Visual Studio 14.0 (2015) and 15.0 (2017) all the way up to but not including version 16.0.<\/p>\n<pre class=\"nums:false lang:default decode:true\">&lt;Installation InstalledByMsi=\"false\"&gt; \r\n   &lt;InstallationTarget Id=\"Microsoft.VisualStudio.Pro\" Version=\"[14.0,16.0)\" \/&gt; \r\n&lt;\/Installation&gt;<\/pre>\n<p>Simply change the upper bound of the version range from 16.0 to 17.0, like so:<\/p>\n<pre class=\"nums:false lang:default decode:true\">&lt;Installation InstalledByMsi=\"false\"&gt;\r\n   &lt;InstallationTarget Id=\"Microsoft.VisualStudio.Pro\" Version=\"[14.0,17.0)\" \/&gt;\r\n&lt;\/Installation&gt;<\/pre>\n<h4>&lt;Prerequisite&gt;<\/h4>\n<p>Next, update the version ranges in the &lt;Prerequisite&gt; elements. Here\u2019s what it looked like before:<\/p>\n<pre class=\"nums:false lang:default decode:true\">&lt;Prerequisites&gt; \r\n   &lt;Prerequisite Id=\"Microsoft.VisualStudio.Component.CoreEditor\" Version=\"[15.0,16.0)\" DisplayName=\"Visual Studio core editor\" \/&gt; \r\n&lt;\/Prerequisites&gt;<\/pre>\n<p>We must update the version ranges to have the same upper bound as before, but in this case we can make the upper bound open ended, like so:<\/p>\n<pre class=\"nums:false lang:default decode:true\">&lt;Prerequisites&gt; \r\n   &lt;Prerequisite Id=\"Microsoft.VisualStudio.Component.CoreEditor\" Version=\"[15.0,)\" DisplayName=\"Visual Studio core editor\" \/&gt; \r\n&lt;\/Prerequisites&gt;<\/pre>\n<p>This means that the Prerequisite needs version 15.0 or newer.<\/p>\n<p>If you have a dependency on Microsoft.VisualStudio.MPF then delete it. This dependency is a legacy one that hasn&#8217;t been needed since before Visual Studio 2010. It looks something like this:<\/p>\n<pre class=\"nums:false lang:default decode:true\">&lt;Dependencies&gt;\r\n   &lt;Dependency Id=\"Microsoft.VisualStudio.MPF.14.0\" DisplayName=\"Visual Studio MPF\" d:Source=\"Installed\" Version=\"[14.0]\" \/&gt;\r\n&lt;\/Dependencies&gt;<\/pre>\n<p>See the updated .vsixmanifest files for <a href=\"https:\/\/github.com\/madskristensen\/MarkdownEditor\/blob\/master\/src\/source.extension.vsixmanifest\">Markdown Editor<\/a>, <a href=\"https:\/\/github.com\/madskristensen\/BundlerMinifier\/blob\/master\/src\/BundlerMinifierVsix\/source.extension.vsixmanifest\">Bundler &amp; Minifier<\/a>, and <a href=\"https:\/\/github.com\/madskristensen\/ImageOptimizer\/blob\/master\/src\/source.extension.vsixmanifest\">Image Optimizer<\/a>.<\/p>\n<h2>Next Steps<\/h2>\n<p>Nothing. That\u2019s it. You\u2019re done.<\/p>\n<p>Well, there is one thing that may affect your extension. Extensions that autoload a package has to do so in the background as stated in the blog post, <a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/2018\/05\/16\/improving-the-responsiveness-of-critical-scenarios-by-updating-auto-load-behavior-for-extensions\/\">Improving the responsiveness of critical scenarios by updating auto load behavior for extensions<\/a>. You can also check out this walkthrough on <a href=\"https:\/\/github.com\/Microsoft\/VSSDK-Extensibility-Samples\/tree\/master\/AsyncPackageMigration\">how to update your extension to use the AsyncPackage\u00a0<\/a>if you haven\u2019t already.<\/p>\n<p><strong><em>What about the references to Microsoft.VisualStudio.Shell<\/em> and other such assemblies?<\/strong> As always with new version of Visual Studio, they are automatically being redirected to the 16.0 equivalent and there is backwards compatibility to ensure it will Just Work<sup>TM<\/sup>.\u00a0 And in my experience with the upgrade is that they in fact do just work.<\/p>\n<p>I\u2019m going to head back to adding VS 2019 support to the rest of my extensions. I\u2019ve got about 40 left to go.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I\u2019ve updated over 30 of my extensions to support Visual Studio 2019 (16.0). To make sure they work, I got my hands on a very early internal build of VS 2019 to test with (working on the Visual Studio team has its benefits). This upgrade process is one of the easiest I\u2019ve ever experienced. [&hellip;]<\/p>\n","protected":false},"author":642,"featured_media":222750,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[294,475],"class_list":["post-19115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-extensions","tag-visual-studio-2019"],"acf":[],"blog_post_summary":"<p>Recently, I\u2019ve updated over 30 of my extensions to support Visual Studio 2019 (16.0). To make sure they work, I got my hands on a very early internal build of VS 2019 to test with (working on the Visual Studio team has its benefits). This upgrade process is one of the easiest I\u2019ve ever experienced. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/19115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/642"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=19115"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/19115\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/222750"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=19115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=19115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=19115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}