Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Private Gallery atom such that VS shows that an extension update is available

I'm using a Visual Studio Private Gallery to publish a VSIX internal to my company. My VSIX shows up in the "Online" section of "Extensions and Updates" in Visual Studio 2012 and I can install it from there: VSIX available to install from "Online"

However, once it's installed, I can't figure out how to update my extension in a way that makes it show up in the "Updates" section of that same dialog box, nor can I figure out how to make Visual Studio notify me that an update is available. VSIX doesn't appear in "Updates" pane even though it's a newer version than installed

I've tried various combinations of the following:

  1. Increasing the version number in the VSIX itself and in the atom.xml
  2. Changing the updated tag inside of the entry tag to the current date and time
  3. Changing the updated tag inside of the feed tag to the current date and time
  4. Changing the published tag inside of the entry tag to the current date and time

My expectation was that a combination of 1, 2, and 3 should be enough to show that there is an update, but to no avail. This guide seems to confirm my expectation:

  • Published - The date/time when the extension was added.
  • Updated - The date/time when the extension was last updated.

I've also tried all 4 at the same time, also to no avail.

I'm serving the gallery from an Apache instance, and I've confirmed that it's setting a correct Last-Modified header for the atom.xml .

Is there some interval at which Visual Studio checks for updates? Does opening the "Updates" section of "Extensions and Updates" not force Visual Studio to check?

Here's the contents of my atom.xml:

<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Visual Studio Extension Gallery</title>
  <id>uuid:CDC295B0-7885-4B59-9BDF-F059A9F4B338;id=1</id>
  <updated>2013-12-11T19:00:00Z</updated>
  <entry>
    <id>MyVSIX..b242c6de-d0a6-4ba1-9672-b866e36607d3</id>
    <title type="text">MyVSIX</title>
    <summary type="text">MyVSIX is a nifty extension that does things.</summary>
    <published>2013-12-11T19:00:00Z</published>
    <updated>2013-12-11T19:00:00Z</updated>
    <author>
      <name>daxelrod</name>
    </author>
    <content type="application/octet-stream" src="vsix/MyVSIX.vsix" />
    <Vsix
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010"
    >
      <Id>MyVSIX..b242c6de-d0a6-4ba1-9672-b866e36607d3</Id>
      <Version>0.5</Version>
      <References />
      <Rating xsi:nil="true" />
      <RatingCount xsi:nil="true" />
      <DownloadCount xsi:nil="true" />
    </Vsix>
  </entry>
</feed>

I should also note that my extension is not Strong Name Signed, because it uses a third party assembly that is unsigned. Does that make a difference?

like image 579
daxelrod Avatar asked Dec 11 '13 19:12

daxelrod


3 Answers

I had the same Issue and made some deep investigation. In my case it was odd, that my extension always shown as "Download" in the Private Gallery instead as "Installed" (the Green Hook). So I guessed there is a missing Link between the Gallery item and the installed Item

The answer is as simple as annoying:

The ID has to be "THE ID". So the Product ID (in the VSIX Configuration) is the reference which has to be in the Atom-File.

In Your case:

<Vsix>
    <Id>b242c6de-d0a6-4ba1-9672-b866e36607d3</Id>
</Vsix>

As you see: Withyout your "MyVSIX..". After that it will recognize your Extension and if installed also hide the "Download" Button within the Gallery

For Update:

It's enough if you increase the < Version > Content.

For The Update Cycle (my experience):

  • It checks on start of the Visual Studio (once Daily, if in Option enabled)
  • It checks every time you open the "Extensions and Updates". So reopen after a save of the XML should be enough.

EDIT: (thanks for the Upvote)

Here the Pictures for better understaning (made in VS2013, but almost same for VS2012)

The ID in the VSIX File. VSIX ProductID

How it should look like in the Atom-Feedfile.

<Vsix>
    <Id>d4d50729-a612-4260-9b2e-3a61ad5e2207</Id>
</Vsix>   

How it should look if you correctly linked between Gallery and VSIX File. Gallery Linking

like image 76
Adrian von Allmen Avatar answered Nov 17 '22 05:11

Adrian von Allmen


We tried to use an atom.xml in a private gallery for an automatic update. It did not work at all, even after removing the name from the ID in the VSIX tag. We are using a package developed for VS 2015.

Then, looking more carefully, we realized that the ID of the package class, that is also present in the vsct file, is different from the ID defined in the manifest file: source.extension.vsixmanifest. While the first is a pure GUID the second is a concatenation of the name, producer and another GUID. Something like: MyVSIX.MyCompany.GUID (in form of xxxxxxxx-xxxx...)

When we used the second one, everything worked perfectly. We even managed to update packages that were previously installed by double-clicking the vsix file.

I want to thank you as this article was a very good start to solve our problem.

All the best, Dan Vasilescu

like image 32
Dan Vasilescu Avatar answered Nov 17 '22 04:11

Dan Vasilescu


it looks like VS only checks for updates once a day, but I wasn't able to get it to detect an updated extension in an Atom gallery.

like image 1
jmoffatt Avatar answered Nov 17 '22 06:11

jmoffatt