Thursday, February 24, 2011

Adding a Private Gallery tab to the Visual Studio 2010 Extension Manager

Visual Studio Gallery - PrivateGalleryPackage

"Add a new tab in the Visual Studio extension manager dialog window to manage private extensions outside the visual studio public gallery. Source code for client and server in available on codeplex ..."

CodePlex - Visual Studio Private Extension Gallery

Extension manager uses intensively MEF to manage extensions in Visual Studio. This technology can be used too to extend the Extension Manager Window by implementing the Microsoft.VisualStudio.ExtensionManager.IVsEtensionManagerDialogProvider with an export MEF attribute.

Implementing this interface is not very trivial so this project uses some codes from an older Nuget project version.

A basic server implementation is also provided.

You can change repository server address with the options page.

Note : Take into account that the project uses assemblies located in the Visual Studio Private Assemblies which are unsupported assemblies and can be change without notifications in future visual studio version.






The CodePlex project includes the VISX,  and the server side setup (i.e. the Private Gallery you host) and source for both.



Anonymous said...

Very interesting extension, but I can't get the server side to work. I have tried to setup the web application to IIS and define the source to the options page, but I get the "The source specified is invalid" error every time I press Add.

If I try to define a local source (e.g. c:\), VS crashes.

I might be doing something wrong since I'm not very familiar with IIS and web apps.

NightmareToxic said...

Hi Anonymous

I managed to get it working, so I decided to share:

1. Copy the contents of C:\Extensions\VsxFactory Strategies Repository Server\Content\D_C\Data\Projets\Codeplex.VsxFactory\VsPrivateGallery\RepositoryServer\obj\Debug\Package\PackageTmp (after unzipping VsxFactory Strategies Repository to an specific folder X.

2. Create a Website

2a. In IIS Manager, right click Add Site, choose a Site Name, set the physical path to your specific folder X, set the Host Name, and click OK.

2b. Convert the folder into a Web Application (not sure if it's needed)

3. If you try to access it right now, (http://yourserver/X/VsixGallery/VsixGallery.svc/Packages), you'll get an error : "The resource cannot be found." This is not very straight-forward, but it means you don't have an App_Data folder containing an Extensions folder, which will contain your VS Extensions. Create App_Data in the root folder of your Application, and inside it create another named Extensions. Put your vsix files inside there. (Maybe the developer thought everyone would open the source code to check before using the extension, so they would figure out the App_Data/Extensions thing)

Your root folder will be like this:

4. Install Visual Studio Private Extension Gallery Extension in your client machine.

5. Go to Tools -> Options -> Environment Tab -> Extension Manager (private)

6. Type a name for your Gallery, and set http://yourserver/X/VsixGallery as source.

7. Click Add.

8. Go to Tools -> Extension Manager, and check your private gallery

9. Voila!