{"id":20455,"date":"2016-08-24T21:26:38","date_gmt":"2016-08-25T01:26:38","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/?p=20455"},"modified":"2019-02-14T17:33:41","modified_gmt":"2019-02-15T01:33:41","slug":"new-requirement-when-updating-team-services-extensions-on-the-marketplace","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/new-requirement-when-updating-team-services-extensions-on-the-marketplace\/","title":{"rendered":"New requirement when updating Team Services extensions on the Marketplace"},"content":{"rendered":"<p>If you develop <a href=\"https:\/\/www.visualstudio.com\/docs\/integrate\/extensions\/overview\">extensions for Visual Studio Team Services<\/a> or Team Foundation Server, there is a\u00a0new requirement during publishing that you should be aware of:\u00a0when updating an extension on the Marketplace, the updated extension&#8217;s\u00a0version number must be greater than the published extension&#8217;s version number.\u00a0To say it another way, <strong>you must increment the version of your extension every time you update it.<\/strong>\u00a0As an example, if your extension is currently published to the Marketplace at version 0.9.0, attempting to upload version 0.8.0 will fail.\u00a0In TFX this will be reflected with a message similar to this:<\/p>\n<p><code>Version number must increase each time an extension is published. Extension: fabrikam.my-extension Current version: 0.9.0 Updated version: 0.8.0<\/code><\/p>\n<p>This change only impacts Team Services extensions, not Visual Studio Code extensions.<\/p>\n<h3>Why the change<\/h3>\n<p>Up until now, the Marketplace did not enforce that\u00a0an extension&#8217;s version number be incremented on update.\u00a0Although this made\u00a0life easier during development, it resulted in problems downstream. For example, different variations of an extension with the same version number make\u00a0it difficult for developers to correlate problems back to the appropriate version of the source code. It also makes\u00a0it difficult\u00a0for Team Foundation Server 2015 users to definitively know\u00a0what version of an extension they are\u00a0actually running. This change is\u00a0also\u00a0necessary to support\u00a0some\u00a0upcoming features (stay tuned).<\/p>\n<h3>Tools to help<\/h3>\n<p>If you already\u00a0increment your extension\u2019s version number before you publish an update, good job &#8211; keep doing what you\u2019re doing! If not or\u00a0you don&#8217;t want to manage your extension\u2019s version, there are a few tooling options\u00a0to help.<\/p>\n<h4>TFX<\/h4>\n<p>The latest version of TFX (0.3.26 and later) introduces a new argument to increment the last segment of the extension&#8217;s version number:<\/p>\n<p><code>tfx extension create --rev-version<\/code><\/p>\n<p>This reads the current version from the manifest file, increments the value in the third segment of the version (the patch segment), writes the new version to the local file, and then creates the package.<\/p>\n<p>As an example, assume the extension manifest file currently has a version of 0.4.10. After running TFX with the &#8211;rev-version argument, the version in the local manifest file and resulting .vsix file will be 0.4.11.<\/p>\n<p>For more information, see <a href=\"https:\/\/github.com\/Microsoft\/tfs-cli\/blob\/master\/docs\/extensions.md\">TFX extension commands<\/a>.<\/p>\n<h4>Build and Release Tasks for Extensions<\/h4>\n<p>A few months ago, we (with help from the ALM Rangers) released a set of\u00a0<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-devlabs.vsts-developer-tools-build-tasks\">build and release tasks<\/a> that help extension developers package, publish, and manage their Team Services and Team Foundation Server extensions. Of course, these tasks were packaged as an extension and made available on the Visual Studio Marketplace.<\/p>\n<p>One of the tasks, <strong>Query Extension Version<\/strong>, queries the Marketplace to\u00a0get the current version of a specified\u00a0extension. The task\u00a0then increments the specified segment\u00a0(MAJOR.MINOR.PATCH) of the extension&#8217;s version. This new version is stored as a variable that can be used in a later Package or Publish task to override the version from\u00a0the manifest file.<\/p>\n<p>As an example, <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-devlabs.team-calendar\">Team Calendar<\/a> is a public extension maintained by us (Microsoft) under our DevLabs publisher. We use the\u00a0build and release extension tasks in a <a href=\"https:\/\/www.visualstudio.com\/en-us\/features\/continuous-integration-vs\">Team Services-hosted CI build process<\/a>\u00a0to package the Team Calendar extension\u00a0when updates are pushed to its public GitHub repository.<\/p>\n<p>A &#8220;<strong>query extension version<\/strong>&#8221; step gets the current version of the published extension, increments the <strong>minor version segment<\/strong>, and saves the new value in a build variable called <strong>Extension.NewVersion:<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/query-version-step.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/08\/query-version-step.png\" alt=\"query-version-step\" width=\"879\" height=\"514\" class=\"alignnone size-large wp-image-20475\" \/><\/a><\/p>\n<p>A later \u201c<strong>package extension<\/strong>\u201d step uses the value from the <strong>Extension.NewVersion<\/strong>\u00a0build variable when creating the .vsix package (no change is made to the source manifest file):<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/package-step.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/08\/package-step.png\" alt=\"Extension package step that overrides the variable with a variable set earlier in the build process.\" width=\"878\" height=\"341\" class=\"alignnone size-full wp-image-20465\" \/><\/a><\/p>\n<p>The end result is a compiled\u00a0.vsix file, with a version that is greater than the version currently published.<\/p>\n<p>We know that any change to a\u00a0day to day process\u00a0can be tough, but this is an important and necessary change. We welcome your feedback on this.<\/p>\n<p>Will Smythe, Program Manager at Microsoft<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you develop extensions for Visual Studio Team Services or Team Foundation Server, there is a\u00a0new requirement during publishing that you should be aware of:\u00a0when updating an extension on the Marketplace, the updated extension&#8217;s\u00a0version number must be greater than the published extension&#8217;s version number.\u00a0To say it another way, you must increment the version of your [&hellip;]<\/p>\n","protected":false},"author":144,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,1],"tags":[],"class_list":["post-20455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-community","category-devops"],"acf":[],"blog_post_summary":"<p>If you develop extensions for Visual Studio Team Services or Team Foundation Server, there is a\u00a0new requirement during publishing that you should be aware of:\u00a0when updating an extension on the Marketplace, the updated extension&#8217;s\u00a0version number must be greater than the published extension&#8217;s version number.\u00a0To say it another way, you must increment the version of your [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/20455","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\/144"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=20455"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/20455\/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=20455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=20455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=20455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}