2
votes

In Azure DevOps, I currently have two NuGet feeds set up: a Primary feed and a Prerelease feed. The Prerelease feed is set up as a upstream source of the Primary feed where I have preview versions of packages automatically pushed frequently and kept separate from what we consider final versions in the Primary feed.

I've followed the documentation to set up upstream sources and it works but only for the first version of a package. So if package Foo.1.0.0-preview01 gets added to the Prerelease feed and installed via Visual Studio, it gets cached into the Primary feed and the package gets restored properly and everything.

But once I create a Foo.1.0.0-preview02 in the Prerelease feed and repeat the steps above (install via VS), the new version doesn't get cached into the Primary feed like the first one. I've tried over the course of several days and with different packages and the behavior has been consistent.

Any help is appreciated.

Edit: More info as request.

The exact steps I took are as follows:

  1. Configure a Primary feed and a Prerelease feed as Primary's upstream source. enter image description here
  2. Azure DevOps creates and pushes a package Foo.1.0.0-preview.20200207.1 to the Prerelease feed through some automated process. It is visible in Prerelease but not Primary. enter image description hereenter image description here
  3. In Visual Studio, have both feeds as package sources. This was done because of the workaround suggested at end of this StackOverflow answer: https://stackoverflow.com/a/56196158/4183606 VS feeds
  4. Install Foo.1.0.0-preview.20200207.1 with either the copied command from Azure DevOps or using the NuGet package manager UI in Visual Studio. enter image description here
  5. See that Foo.1.0.0-preview.20200207.1 is now visible in Primary feed. enter image description here
  6. Make some changes to Foo package and Azure DevOps creates and pushes a new one Foo.1.0.0-preview.20200115.2 to the Prerelease feed.
  7. Install Foo.1.0.0-preview.20200207.2 using the NuGet package manager in Visual Studio. enter image description here
  8. Foo.1.0.0-preview.20200207.2 does not appear in Primary feed.
1
How about try to use the package Foo.1.0.1-preview instead of Foo.1.0.0-preview02? Are you install the package from Primary feed in the Visual Studio? Would you please share us some more steps and images to reproduce this issue. Thanks.Leo Liu-MSFT
So it looks like incrementing the actual version number and not the preview suffix number doesn't make a difference. I've added repro steps to the original post.QDev
The package graph documentation is dense...Curious about this issue, although I don't know a solution. I see from your screenshot that your primary feed is taking from the @local view of your secondary feed. Are all your prerelease packages available in that view in your secondary feed?Eric Smith
Yes, all packages in the upstream source are in that view. The local view is the default and contains all packages on that feed. Other views are currently empty and not used.QDev
@QDev, It seems since you add both feeds as package sources, when you install Foo.1.0.0-preview.20200207.2 using the NuGet package manager in Visual Studio, it get the package directly from the Prerelease feed instead of the Primary feed. So, it not cache in the Primary feed. How about install that package only enable Primary feed in Visual Studio?Leo Liu-MSFT

1 Answers

0
votes

With LeoLiu-MSFT's help, the problem seems to be related to having both the upstream source (Prerelease) and main source (Primary) available in Visual Studio. I removed the Prerelease feed from VS and it worked.

I had Visual Studio set up this way because of a workaround suggestion found at the end of this StackOverflow answer that would allow me to see uncached upstream packages in NuGet package manager: https://stackoverflow.com/a/56196158/4183606

After removing the upstream source (Prerelease in my case), and then running the powershell command to install the preview version against the Primary feed, it seemed to have forced the Primary feed to look for versions in the upstream feeds that it doesn't have and then caching it.