How to add new packages when using an Azure Artifcat as package source

Viewed 37

Due to our obfuscasting library(Babel4), we had to create a Azure artifact to host their nuget package.

It works fine, but if we try to add a package that has never been referenced in our .Net Core project(in visual studio), we cannot find it.

I was able to manually install it through the command line:

Install-Package Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson 

but then on another computer if I try to restore the references, I get this error:

  XXX.YYY: [NU1101] Unable to find package 
  Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson. No packages exist with this id in source(s): Babel3

(Babel3 is our artifact name).

But Azure Artifacts has Nuget(and other) configured as upstream sources: enter image description here

On Azure Artifact, if I try to look for a package that I don't have installed, it doesn't find it(and I'm owner of the artifact): enter image description here

What should I do? Configure another package source in Visual Studio? Something on azure?

Thank you very much

EDIT Here is is my nuget.config if it helps:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="Babel3" value="https://pkgs.dev.azure.com/XXXXX/_packaging/Babel3/nuget/v3/index.json" />
  </packageSources>
  <config>
    <add key="repositoryPath" value="packages\" />
    <add key="globalPackagesFolder" value="packages\" />
  </config>
</configuration>
1 Answers

Please go to Feed settings for Babel3 -> Check if you have added "Project Collection Build Service(org)" and "project build service(org)" as collaborator, contributor, or owner role. As per the doc, if you don't have enough permission on feed, the pipeline cannot fetch package from upstream.

enter image description here enter image description here

I can fetch the nuget package from upstream to local feed. enter image description here

BTW, please make sure the project settings -> pipelines -> settings -> Job authroized scope is not limited if the feed from another project. enter image description here

Edit: Since you restore from local machine and "nuget gallery" is public resource. Please try to add it directly in nuget.config.

enter image description here

Related