Quick Tip: Getting LightSwitch Extensions to Install into Visual Studio 2013 Preview

So you want to try out Visual Studio 2013 Preview and test out the awesome new LightSwitch features on your own real projects, but you can’t because your extension(s) won’t install into the VS2013 preview. Here’s a tip on how you can force the extension to install. But first, some background….

Visual Studio LightSwitch extensions are built as VSIX files, just like any other Visual Studio extension. Some extensions are built for specific versions of Visual Studio. The extension author decides what versions are supported when the VSIX is created. Because of this, when we release a preview of the next version of Visual Studio, extensions that you use are probably not available yet for the new version.

When you upgrade a LightSwitch project that uses extensions from one version of Visual Studio to the next, you really should have all the extensions available to the new version of Visual Studio. Less headaches that way :). So you need to install the extensions first, then you can open your LightSwitch Solution in the new version of Visual Studio and it will perform the upgrade smoothly. If you don’t have the extensions installed, you will get a warning and your project will not build correctly until you remove all the references. This can be a major pain if you are using a lot of extensions.

You can force an extension to install into any version of Visual Studio by changing the manifest. However, keep in mind that depending on the extension, it may not work correctly in the new version – ultimately it’s the extension author’s responsibility to upgrade their extension. However, many LightSwitch extensions should migrate just fine, particularly if they are already supporting multiple Visual Studio versions.

Here’s how to do it.

1. Rename the .VSIX extension to .ZIP

2. Extract the contents of the archive and open the .vsixmanifest contained inside with a text editor like notepad

3. Locate the <SupportedProducts> XML element and add version 12.0. i.e:

  <VisualStudio Version="10.0">
  <VisualStudio Version="11.0">
  <VisualStudio Version="12.0">

4. Alternately you may see an <InstallationTarget> element instead. Add “12.0” to the version attribute. i.e.

    <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,12.0]" />

5. Save the .vsixmanifest, zip up the contents again, and rename the archive with the .vsix extension

6. Double-click the VSIX to install it into all the versions of Visual Studio you have on your system.

Now you should be ready to upgrade your project by opening it in Visual Studio 2013 Preview. I smoke tested the Filter Control, Office Integration Pack and Bing Map Control (available in the Contoso Construction sample) and they seem to be working so far so good.

I hope this helps you start testing your LightSwitch projects in the Visual Studio 2013 preview. I can’t tell you how important it is for us to find bugs sooner than later (especially upgrade issues) so thank you for helping make LightSwitch the best it can be. Remember if you have any feedback, please visit the LightSwitch forum. If you know you’ve found a bug, enter it directly into our bug database here: https://connect.microsoft.com/visualstudio