I have paid licensed NuGet packages retrieved via private NuGet source. It prompts for username and password when trying to search for any packages in visual studio from that source. The application (Xamarin Forms) builds just fine with these licensed packages.
Now Azure DevOps, on the other hand, fails as it's not able to restore nuggets from nuget.org.
After researching, tried 2 options:
Option 1: To use "Service connections" in DevOps to connect to this source with credentials, just like in Visual Studio, and use NuGet restore to select that Service connection. This generates a temp nuget.config file, with it's full content being: <configuration/>
and the task fails to locate missing NuGets.
Option 2: To use Artifacts, and push manually from my local machine. I've pushed the project referenced files from their location, but their artifact description has "Trial version" attached at the end. The build still fails with this error:
##[error]The NuGet command failed with exit code(1) and error(NU1101: Unable to find package Infragistics.XF.DV. No packages exist with this id in source(s): 94785e32-5a7b-4923-93b0-abe71c3c1f4c
I assume that it fails in both cases because of the temp nuget.config file is blank. After option 2, the config file gets deleted, so I cant see what's actually inside.
Also note, that this source is extremely slow when browsing using Visual Studio.
Please advise how I could get private packages into DevOps?
EDIT Answer: The Nuget restore task, nuget.config path was blank, as I expected a new one to be auto-generated with similar to answer's content. I added a Nuget.config into the project's source code with 2 feeds and it worked correctly.
Also, you can find your visual studio global Nuget.config at: %AppData%\NuGet
.