VSIX Extension Gallery for Visual Studio

Your very own fully featured self-hosted Extension Gallery for Visual Studio.

In a previous article I discussed how to create Item and Project templates and bundle them into their own VSIX installers.

However, now that you have your VSIX installer the question becomes how do you distribute it to all your coworkers?

It would be great if they could use the Extensions and Updates manager that is already built into Visual Studio. That handles installing, uninstalling, searching and auto-updating extensions. Pretty neat!

However the project you have is not suitable to have in a public VSIX repository like the Visual Studio Marketplace.

The public marketplace is no place for internal company extensions unfortunately.

The public marketplace is no place for internal company extensions unfortunately.

You need to host your own private marketplace.

But how?

TL;DR; I built one

Private Extension Galleries

Microsoft has addressed this issue but only through documentaton. There are no concrete implementations available from Microsoft nor any others on how to host and serve these files. Neither is there a simple way to leverage the advanced features the Extension Manager provides (such as search, ratings and download counts).

So what is available?

Unfortunately the commercial offerings are incredibly limited. The main one myget.org is purely online and regretfully not free. The popular Nexus Repository by Sonatype dropped support for VSIX files in their latest version (v3).

There are some half-automated solutions out there, others very manual. The worst thing about most of the automatic offerings is that they require being run on an existing webserver (IIS, Apache, Ngix, etc) and require a relational database system to store data.

So there really is no freely available out-of-the-box solution available.

Until now...

Introducing vsgallery

The VS-Gallery running inside of Visual Studio's Extension Manager

The VS-Gallery running inside of Visual Studio's Extension Manager

With the current rise in popularity of the Microservice I found it really disappointing that a simple click-to-run solution wasn't available to run a private Visual Studio Marketplace.

I wanted something simple and self-contained that could be run without installing and configuring multiple other systems (such as a webserver and a database system).

Before I bore you with more text, go ahead and test vsgallery out. Just download the latest release and run the executable file.

It is really that super simple. I promise!

Download vsgallery

vsgallery is a single executable file which acts as a complete self hosted extension gallery for Visual Studio 2010 and newer. It really is ultra simple to configure and run. You are up and running in a few seconds.

All for the low low price of FREE!

The whole system runs as a single self-contained executable and uses no database. All files and data are stored on the local file system which makes maintenance and backup super simple.

Features

  • Fully featured Extension Gallery ready to use in Microsoft Visual Studio.
  • Counts downloads of extensions
  • Displays star ratings, release notes and links to project home pages
  • Offers a simple to use REST API to submit ratings and upload new VSIX packages
  • Atom and JSON feeds for available packages
  • It's FREE!

How to install into Visual Studio

In Visual Studio

Tools > Options > Environment > Extensions and Updates

Add a new entry and copy in the URL of the main Microservice Atom Feed.

By default the URL is http://YOUR_SERVER:5100/feeds/atom.xml

Please consult this MSDN document for any further details and alternative options on how to install a Private Extension Gallery in Visual Studio.

How it works

The microservice is configured via the config.ini file that sits in the same folder as the main executable.

The .vsix files, along with their download counts and ratings data are stored in a subfolder of the main service executable VsixStorage/ (this subfolder is configurable). This makes taking backups and moving the service between machines super easy as the root folder contains the entire Microservice state and data.

root-folder
  |--vsgallery.exe
  |--config.ini
  |--VsixStorage
    |--atom.xml
    |--First.vsix
    |--Second.vsix
    |--AndSoForth.vsix

Latest release

The vsgallery API

The Microservice comes with a rich HTTP based API. You can plug the data and its functionality directly into your development portal or company intranet with minimal web programming. Even direct integration into your continuous integration platforms and communication pipelines such as #slack are possible.

The vsix_id required by many of the endpoints can be obtained by reading the id field in the feed endpoints.

[GET] /feeds/atom.xml

This is the main entry point for the VSIX feed and serves up the Syndicate-Feed compatible Atom file containing all available extensions on the server.

This is the URL endpoint that should be used in Visual Studio.

See How to install into Visual Studio for more information.

[GET] /api/ratings/{vsix_id}

Retrieves the rating value and vote count for a particular VSIX package by its ID.

curl -X GET 
     http://VSGALLERY_SERVER:5100/api/ratings/VSIX_ID

The return type is the following JSON

{
  "rating": 4.3,
  "count": 19
}

[POST/PUT] /api/ratings/{vsix_id}

Submitting rating values for a particular VSIX package by its ID. The post payload should be just raw string and contain a single floating point value in the range between [0.0, 5.0].

The example below will post a rating of 3.5 stars to VSIX package with the id VSIX_ID

curl -X POST 
     -H "Content-Type: text/plain" 
     --data "3.5" 
     http://VSGALLERY_SERVER:5100/api/ratings/VSIX_ID

[GET] /api/json

JSON feed for the entire package catalog. Same data that is being fed through the atom feed but just in a handier JSON format.

[POST/PUT] /api/upload

This endpoint accepts form-data uploads of one or more .vsix files to the hosting service.

The example below will upload the file my.vsix to the gallery server and propose a new name for it renamed.vsix (you can omit the filename param to use the original name)

curl -X POST 
     --form "file=@my.vsix;filename=renamed.vsix" 
     http://VSGALLERY_SERVER:5100/api/upload

To upload multiple files simply add more form elements. The example below uploads two VSIX files at the same time.

curl -X POST 
     --form "file1=@my.vsix" 
     --form "file1=@your.vsix" 
     http://VSGALLERY_SERVER:5100/api/upload

Closing

So if you're searching for a simple solution for your internal, low traffic, extension gallery then please consider vsgallery.

If you do try it out, please leave me feedback in the comments below.

Peace!

vsgallery



Software Developer
Contact Me


Developer & Programmer with +18 years professional experience building software.