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

3

17

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?

Hine answered 11/12, 2013 at 19:32 Comment(0)
M
18

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

Melodious answered 17/12, 2013 at 12:45 Comment(3)
Thank you so much, that worked! Just to be clear, we are talking about the <Id> element inside the <Vsix> element.Hine
Thanks for your feedback. I've added the VSIX Tag in the exmaples to clarify the location.Melodious
Great - thank you! Still wondering why the heck Microsoft placed the name of the Extension + .. in front of the id in their guide for private galleriesSinkhole
H
4

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

Hoes answered 12/8, 2016 at 6:54 Comment(0)
M
1

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.

Modestine answered 11/12, 2013 at 20:56 Comment(1)
Unfortunately, even after several days, there is still no indication of updates.Hine

© 2022 - 2024 — McMap. All rights reserved.