0
votes

So I have an Azure Artifacts feed. This feed has some packages. One if it is Newtonsoft.Json lets say 10.0.4 version. The feed is set up with an upstream source for Nuget.

When I add this feed to my project, my expectation is that when I want to get NewtonSoft latest, I would be able to get it. However, in Visual Studio or Nuget Restore, it fails to see any other version. The only version it can see is 10.0.4. I am expecting that since I specified an upstream source, it would get the packages from upstream.

I tried unlisting the 10.0.4 version, now it says newton soft is not even found.

What am I missing? What could be going on here?

2
Hi Did you get a chance to check out below answer? Please let me if it helped you to fix this issueLevi Lu-MSFT
No thats not the issue. I tried all that stuff. Did not workdgorti

2 Answers

1
votes

For me that was a problem with permissions to the Azure Artifacts package repo. If you are part of a group which has "Reader" access to the Azure Artifacts package repository, your nuget restores or npm installs (for JavaScript packages) WILL NOT be able to add packages to the Azure Artifacts package repository mirror/proxy.

Set the permissions of your teams/people with access to the Azure Artifacts package repository one level higher than "Reader" - set them to "Collaborator": enter image description here

This is an error that's easy to miss since if you are the Artifacts package repo creator, you won't get any access errors other people might be having because you're the owner of the repo (in the picture below I'm Artur)

0
votes

Once you've enabled an upstream source, any user connected to your feed can install a package from the remote feed, and your feed will save a copy.

If you add your Artifacts feed in the Package sources in Visual Studio. When you search for package NewtonSoft within your artifact feed in Visual Studio. It is the default behavior that you can only see the saved copy of package NewtonSoft.

To install the NewtonSoft latest, you can search and install it in the nuget.org package source(You need to add nuget.org to Package sources if it is not listed in the package source list )

enter image description here

Or you can use command line to install the NewtonSoft latest by specifying the version parameter. See below:

Install-Package Newtonsoft.Json -Version 12.0.3

You can also directly add NewtonSoft latest version as package dependency to your project by editting .csproj or package.config file. When you restore your packages. if the NewtonSoft latest is not found in your Artifacts feed, it will be downloaded from the upstream source.