Category: visual studio extensibility
AgileObjects on Wed, 25 May 2016 15:55:08
I've written a Visual Studio extension which installs
using an MSI. The install puts a
in the right place, and the extension appears in the Extension Manager as expected:
The problem is, when I publish a new version on the Visual Studio Gallery, the Extension Manager does not report it. I add the new version by creating a new installer and editing the existing page. Each new installer has a new ProductCode, PackageCode and ProductVersion (I update the MSI setup project and the version number in the included extension.vsixmanifest), but the same UpgradeCode; an example 'upgrade' commit can be found on GitHub here.
The extension.vsixmanifest is as follows - I replace the 'Publisher' attribute value with the value from the assembly info during installation:
<?xml version="1.0" encoding="utf-8"?> <PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011"> <Metadata> <Identity Id="2d5de770-50e9-4dcf-87e9-ea1ed1b43b68" Version="18.104.22.168" Language="en-US" Publisher="$author$" /> <DisplayName>ReadableExpressions.Visualizers</DisplayName> <Description xml:space="preserve">A set of Debug Visualizers providing readable views of Expressions.</Description> <MoreInfo>https://github.com/AgileObjects/ReadableExpressions</MoreInfo> </Metadata> <Installation InstalledByMsi="true" AllUsers="true"> <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[10.0-15.0]" /> <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0-15.0]" /> </Installation> <Dependencies/> <Assets/> </PackageManifest>
What am I missing?
DotNet Wang on Fri, 27 May 2016 09:42:46
>>"Each new installer has a new ProductCode, PackageCode and ProductVersion"
Why did you set new productcode & packagecode for each new installer? Visual Studio will treat them as a totally different extension. Please keep the consistency of productcode & packagecode.
AgileObjects on Fri, 27 May 2016 15:15:37
I update the ProductCode and PackageCode because Visual Studio recommends it when I update the version number:
...isn't tying various installers to one product what the UpgradeCode is for? Won't keeping the same ProductCode and PackageCode cause issues with a new installer being able to uninstall previous versions? My understanding of the various codes comes from here.
AgileObjects on Mon, 30 May 2016 22:40:06
So it appears that changing the ProductCode and PackageCode is the right thing to do.
The issue appears to be that when the extensions service is queried for the latest version of my extension, it returns a blank string - the same result as if you query with an invalid extension identifier:
AgileObjects on Tue, 31 May 2016 19:14:53
OhhhhhhKAY. I've solved this, and it turned out to be a problem with the Visual Studio Gallery page editor.
When you add an extension, you're shown a VSIX ID box:
When you edit an extension (I'm using Chrome), that box has disappeared!
It's still in the DOM, but it's hidden from view. Because of this, I never entered my extension's VSIX ID into the form, it didn't have a value associated with it, and the extensions service therefore didn't return a version number for that ID. The Extension Manager uses the extensions service to find out the latest versions of installed extensions, so it wasn't reporting new versions of mine.
The VSIX ID box reappears if you deselect then reselect one of the extension's supported Visual Studio versions, so I've been able to assign the ID that way. The service now returns a version number, and the Extension Manager therefore shows available updates: