2

So I created a private extension gallery in Visual Studio and published an extension.

I wanted to create another extension which would automatically update the first one when an update is available. I found a sample source code (https://github.com/madskristensen/ExtensionUpdater) for seeking and updating extensions automatically using the ExtensionRepositoryService which exposes ability to query an online Visual Studio Extensions repository.

The ExtensionRepositoryService comes predefined and connected to the Visual Studio Gallery once it is returned using the Package.GetService(Type) method the following way:

var repository = (IVsExtensionRepository)GetService(typeof(SVsExtensionRepository));

Querying the repository later is achieved using the following code:

var entry = _repository.CreateQuery<GalleryEntry>(false, true, "ExtensionManagerUpdate")
                        .Where(e => e.VsixID == extension.Header.Identifier)
                        .AsEnumerable()
                        .FirstOrDefault();

My question is: Is it possible to utilize the same API to connect to a private VS gallery and query the provided extensions in the gallery?

1 Answers1

0

I ended up creating a CustomGallery class which implements the IVsExtensionRepository interface

The class has one constructor that receives XML file path and parses the XML to read the private gallery atom file. I used Lync to query the CustomGallery object easily

  • Could you please post\refer to your implementation of IVsExtensionRepository as I tried to search all the web to find any implementation for that interface but no way... I suffered to imitate the main extension gallery functionalities for the purpose of private extension gallery... Thanks. – Abdulhameed Nov 21 '22 at 02:05