在私人图库中隐藏不兼容的扩展程序

时间:2015-08-26 10:01:09

标签: visual-studio visual-studio-extensions

我们在公司内部有一个私人扩展库,其中包含各种扩展(例如本土扩展,以及来自VersionOne的扩展)。

这些扩展只是加载到服务器上的一个目录中,该目录包含Visual Studio要读取的$("#r").click(function () { var sel = s.val(); s.children("option:last").remove(); //remove last option (use option:first to remove the first) var newval = s.val(); if(sel !== newval && newval)s.change(); //fire change if the removed item was the selected one, but not if not items are left. }); 文件 - 每当上传新扩展时,都会手动操作此文件。

atom.xml

此设置的问题在于,当存在多个版本的扩展时(对于不同的Visual Studio安装),您需要在<?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> 中创建多个条目来容纳这些条目。在Visual Studio中查看此库时,这些扩展名将显示在列表中,即使它们与VS版本不兼容。

Extensions & Updates View

有没有办法配置atom.xml,以便只提供与您正在查看图库的Visual Studio版本兼容的扩展程序?

1 个答案:

答案 0 :(得分:1)

我在公司的私人画廊看到同样的事情。使用.NET Reflector进行一些挖掘表明,Visual Studio库中的扩展与Atom Feed扩展的处理方式不同。

据我所知,.VSIX文件中的扩展VS兼容性信息(版本和SKU)在下载之前不会被提取(您会注意到,如果您尝试在VS2013上安装VS2015扩展,它将会失败如果所需的版本是独家的)。我猜测Visual Studio库在您上传扩展程序时会提取兼容性信息,此信息用于过滤扩展管理器中的条目。

长话短说,Atom Feed xml中指定的扩展没有在下载之前提供VS兼容性信息的机制。我认为这需要更改vsx-syndication-schema(http://schemas.microsoft.com/developer/vsx-syndication-schema/2010),显然是对Extension Manager代码的更改。我打算在microsoft.connect.com上输入。