Geeks With Blogs

@jakobehn

News

Microsoft Community Contributor Award 2011


Jakob Ehn Visual Studio ALM MVP

 

Updated January 13th 2013:  Added note about ASP.NET MVC 4.0 prerequirement


Note: The installer and the complete source code is available over at CodePlex at the following location: http://inmetavsgallery.codeplex.com

 

Extensions and addins are everywhere in the Visual Studio ALM ecosystem! Microsoft releases new cool features in the form of extensions and the list of 3rd party extensions that plug into Visual Studio just keeps growing. One of the nice things about the VSIX extensions is how they are deployed. Microsoft hosts a public Visual Studio Gallery where you can upload extensions and make them available to the rest of the community. Visual Studio checks for updates to the installed extensions when you start Visual Studio, and installing/updating the extensions is fast since it is only a matter of extracting the files within the VSIX package to the local extension folder.

But for custom, enterprise-specific extensions, you don’t want to publish them online to the whole world, but you still want an easy way to distribute them to your developers and partners. This is where Private Extension Galleries come into play. In Visual Studio 2012, it is now possible to add custom extensions galleries that can point to any URL, as long as that URL returns the expected content of course (see below).Registering a new gallery in Visual Studio is easy, but there is very little documentation on how to actually host the gallery.

Visual Studio galleries uses Atom Feed XML as the protocol for delivering new and updated versions of the extensions. This MSDN page describes how to create a static XML file that returns the information about your extensions. This approach works, but require manual updates of that file every time you want to deploy an update of the extension.

Wouldn’t it be nice with a web service that takes care of this for you, that just lets you drop a new version of your VSIX file and have it automatically detect the new version and produce the correct Atom Feed XML?

Well search no more, this is exactly what the Inmeta Visual Studio Gallery Service does for you :-)

image

Here you can see that in addition to the standard Online galleries there is an Inmeta Gallery that contains two extensions (our WIX templates and our custom TFS Checkin Policies). These can be installed/updated i the same way as extensions from the public Visual Studio Gallery.


Installing the Service

  1. The service uses ASP.NET MVC 4.0, so make sure that you have this installed on your web server.
  2. Download the installer (Inmeta.VSGalleryService.Install.msi) for the service and run it.
    The installation is straight forward, just select web site, application pool and (optional) a virtual directory where you want to install the service.

    image 

    Note: If you want to run it in the web site root, just leave the application name blank

  3. Press Next and finish the installer.

  4. Open web.config in a text editor and locate the the <applicationSettings> element

  5. Edit the following setting values:

    • FeedTitle
      This is the name that is shown if you browse to the service using a browser. Not used by Visual Studio

    • BaseURI
      When Visual Studio downloads the extension, it will be given this URI + the name of the extension that you selected. This value should be on the following format:
      http://SERVER/[VDIR]/gallery/extension/

    • VSIXAbsolutePath
      This is the path where you will deploy your extensions. This can be a local folder or a remote share. You just need to make sure that the application pool identity account has read permissions in this folder

  6. Save web.config to finish the installation

  7. Open a browser and enter the URL to the service. It should show an empty Feed page:


    image 

Adding the Private Gallery in Visual Studio 2012
Now you need to add the gallery in Visual Studio. This is very easy and is done as follows:

  1. Go to Tools –> Options and select Environment –> Extensions and Updates

  2. Press Add to add a new gallery

  3. Enter a descriptive name, and add the URL that points to the web site/virtual directory where you installed the service in the previous step



     image

  4. Press OK to save the settings.

Deploying an Extension
This one is easy: Just drop the file in the designated folder! :-)  If it is a new version of an existing extension, the developers will be notified in the same way as for extensions from the public Visual Studio gallery:

image

I hope that you will find this sever useful, please contact me if you have questions or suggestions for improvements!

Posted on Wednesday, November 7, 2012 8:47 PM Visual Studio 2012 | Back to top


Comments on this post: Using Private Extension Galleries in Visual Studio 2012

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
Any idea what would cause a HTTP/1.1 406 Not Acceptable? When I run the code on my box it works. When I put it on a server I get a 406. I am pretty sure the setup is the same.

Thanks!
Left by Jerry on Nov 28, 2012 8:57 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
Thanks, I didn't realize you could do this for extensions. Thanks for sharing
Left by Mark Pearl on Nov 29, 2012 5:17 AM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
Hello.
Great idea.
Unfortunately I could't get it working. I made changes in configuration as described:

<applicationSettings>
<Inmeta.VSGalleryService.Properties.Settings>
<setting name="FeedTitle" serializeAs="String">
<value>My VS Gallery</value>
</setting>
<setting name="BaseURI" serializeAs="String">
<value>http://localhost/vsgallery</value>
</setting>
<setting name="VSIXAbsolutePath" serializeAs="String">
<value>C:\VSIXRepo</value>
</setting>
</Inmeta.VSGalleryService.Properties.Settings>
</applicationSettings>

But when I access "http://localhost/vsgallery" I get emopty page. Folder 'C:\VSIXRepo' contains some *.vsix.
What can be wrong?
Left by Seregi on Dec 12, 2012 6:25 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
Sorry. It works perfectly. It'd by nice to have ability to add images and icons for extensions :
<entry>
<link rel="icon" href="VSIXImages/logo.ico" />
<link rel="previewimage" href="VSIXImages/PreviewImage.jpg" />
</entry>
Left by Seregi on Dec 12, 2012 6:49 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
@Seregi: Great, thanks for using the extension gallery. Yes,, I'm currently looking into adding support for images at the moment. Please add requests/bugs on the CodePlex site
Left by Jakob Ehn on Dec 13, 2012 8:14 PM

# Excellent, just what I have been looking for
Requesting Gravatar...
I maintain two instances of Visual Studio 2012. Same install, but two different instances using the rootSuffix switch.

This is exactly what I have been looking for. Thanks a lot.
Left by Don on Feb 20, 2013 5:45 AM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
Really helpful, thanks. Any ideas how to add some username and password security to the private gallery?
Left by Dave E on Jul 26, 2013 1:55 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
@Dave: Sorry, Visual Studio don't support user authentication for galleries, it will not prompt you for credentials but instead just fail with with access denied if you enable authentication on your gallery service
Left by Jakob Ehn on Sep 30, 2013 12:45 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
I'd really like to use this great tool. But I'm having Problems with either 404 errors (path to gallery/Extension-Provlem I guess) when using the server out of box. Or if I modify the method BuildUri in the GalleryController to point to the correct location all I get is a 406 error. I then changed all GetStream calls to use FileAccess.Read in the GalleryController and also gave the Application Pool User Full Control permissions on both the website and the vsix folder location (for testing pruposes only). Unfortunatly that didn't change a thing...
I'm hosting the gallery server on a IIS8.5 (Server2012 R2) and I'm using a dedicated application pool and website, so the gallery server is located in the root.
Any Ideas?

Best regards
Sascha
Left by Sascha on Jan 14, 2014 1:51 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
@Sascha: May I recommend you to look at the new version of the Inmeta Visual Studio Gallery that I just published? Among a lot of things, it uses a SQL database for storing extensions so you don't have to struggle with the file permissions etc.

I blogged about it here:
http://geekswithblogs.net/jakob/archive/2013/12/26/inmeta-visual-studio-extension-gallery-ndash-version-2.0.aspx

The solution is deployed on the CodePlex site
Left by Jakob Ehn on Jan 14, 2014 1:58 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
Thanks for the fast reply! Very much appreciated.
I do not want to go to SQL Server based version at the moment because we only host a few files there.
By accident I just got it working. I had the vsix files located in C:\VsixExtensions and that just does not work.
Now I created the directory strurcture like this C:\VsixExtensions\gallery\Extension and moved the files down there.
My web.config looks like this:

<setting name="FeedTitle" serializeAs="String">
<value>My Visual Studio Extensions</value>
</setting>
<setting name="BaseURI" serializeAs="String">
<value>http://vsix/gallery/Extension/</value>
</setting>
<setting name="VSIXAbsolutePath" serializeAs="String">
<value>c:\VsixExtensions\gallery\Extension\</value>
</setting>
</Inmeta.VSGalleryService.Properties.Settings>


This way it works like a charm!

Thanx again for sharing!
Sascha
Left by Sascha on Jan 14, 2014 2:27 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
@Jakob "Visual Studio don't support user authentication for galleries".
I tried with the "pass-through" authentication over the Basic Http with the schema user:password@hostname but it doesn't work either. So no chances to create a "truly private" gallery?
Left by layos on Oct 15, 2014 4:08 PM

# re: Using Private Extension Galleries in Visual Studio 2012
Requesting Gravatar...
@layos: No, unfortunately there is not.
Left by Jakob Ehn on Nov 18, 2014 10:45 AM

Your comment:
 (will show your gravatar)


Copyright © Jakob Ehn | Powered by: GeeksWithBlogs.net | Join free