Obsidian Phoenix
Obsidian Phoenix

Reputation: 4155

Hiding Incompatible Extensions in a Private Gallery

We have a private Extension Gallery within the company, that houses a variety of extensions (e.g. home-grown extensions, and those from VersionOne).

These extensions are just loaded into a directory on the server, which contains the atom.xml file for Visual Studio to read - this file is manipulated by hand whenever a new extension is uploaded.

<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom"> 
  <title type="text">Private Extension Gallery</title> 
  <id>uuid:874a62b3-c36c-4443-aeb9-498e4c6e589d;id=1</id> 
  <updated>2013-12-06T12:00:00Z</updated> 

  <!-- Version One TFS Policies -->
  <entry> 
    <id>CC777458-29A8-4B89-B95A-416BE5F6198A</id> 
    <title type="text">VersionOne TFS Checkin Policy For 2012</title> 
    <summary type="text">TFS Checkin policy from VersionOne for Visual Studio 2012.  Requires code commits to contain a VersionOne identifier</summary> 
    <published>2015-07-29T08:22:00Z</published> 
    <updated>2015-07-29T08:22:00Z</updated> 
    <author> 
      <name>VersionOne</name> 
    </author> 
    <category term="" /> 
    <link rel="icon" href="Resources/VersionOne.ico" />
    <content type="application/octet-stream" src="VersionOne.Integration.Tfs.Policy.VS2012.vsix" /> 
    <Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010"> 
      <Id>CC777458-29A8-4B89-B95A-416BE5F6198A</Id> 
      <Version>1.2</Version> 
    </Vsix> 
  </entry>
   <entry> 
    <id>9D7E0DF5-0A4D-4B43-9D73-4AD3F83260FA</id> 
    <title type="text">VersionOne TFS Checkin Policy For 2013</title> 
    <summary type="text">TFS Checkin policy from VersionOne for Visual Studio 2013.  Requires code commits to contain a VersionOne identifier</summary> 
    <published>2015-07-29T08:22:00Z</published> 
    <updated>2015-07-29T08:22:00Z</updated> 
    <author> 
      <name>VersionOne</name> 
    </author> 
    <category term="" /> 
    <link rel="icon" href="Resources/VersionOne.ico" />
    <content type="application/octet-stream" src="VersionOne.Integration.Tfs.Policy.VS2013.vsix" /> 
    <Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010"> 
      <Id>9D7E0DF5-0A4D-4B43-9D73-4AD3F83260FA</Id> 
      <Version>1.2</Version> 
    </Vsix> 
  </entry>
  <entry> 
    <id>VersionOne.Integration.Tfs.Policy.Deployment.VS2015.50865266-cdad-4160-bb0b-b4090eaaf222</id> 
    <title type="text">VersionOne TFS Checkin Policy For 2015</title> 
    <summary type="text">TFS Checkin policy from VersionOne for Visual Studio 2015.  Requires code commits to contain a VersionOne identifier</summary> 
    <published>2015-07-29T08:22:00Z</published> 
    <updated>2015-07-29T08:22:00Z</updated> 
    <author> 
      <name>VersionOne</name> 
    </author> 
    <category term="" /> 
    <link rel="icon" href="Resources/VersionOne.ico" />
    <content type="application/octet-stream" src="VersionOne.Integration.Tfs.Policy.VS2015.vsix" /> 
    <Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010"> 
      <Id>VersionOne.Integration.Tfs.Policy.Deployment.VS2015.50865266-cdad-4160-bb0b-b4090eaaf222</Id> 
      <Version>1.2</Version> 
    </Vsix> 
  </entry>
  <!-- END Version One TFS Policies -->   
</feed>

The issue with this setup, is that when multiple versions of an extension exist (for different visual studio installations), you need to create multiple entries in the atom.xml to house these. When viewing this gallery in Visual Studio, these extensions appear in the list, even though they are not compatible with the VS version.

Extensions & Updates View

Is there any way to configure the atom.xml so that is will only serve up extensions that are compatible with the version of Visual Studio that you are viewing the gallery from?

Upvotes: 2

Views: 144

Answers (1)

Greg Fullman
Greg Fullman

Reputation: 11

I'm seeing the same thing for the private gallery at my company. Doing a little digging with .NET Reflector shows that extensions from the Visual Studio gallery are handled differently from Atom Feed extensions.

As far as I can tell, the extension VS compatibility information (version and SKU) within the .VSIX file isn't extracted until downloaded (you'll notice that if you try to install your VS2015 extension on VS2013 it will fail if the required versions are exclusive). I'm guessing the Visual Studio gallery extracts the compatibility information when you upload the extension, and this info is used to filter entries in the Extension Manager.

Long story short, extensions specified in the Atom Feed xml have no mechanism for providing VS compatibility info prior to download. I think this would require a change to the vsx-syndication-schema (http://schemas.microsoft.com/developer/vsx-syndication-schema/2010) and obviously a change to the Extension Manager code. I'm planning on entering this on microsoft.connect.com.

Upvotes: 1

Related Questions