I have a .net project that I am building a pipeline for in Gitlab CI to build and test merge requests.
In my .gitlab-ci.yml file, I have a script under my restore job that simply restores the NuGet packages using the command:
C:\tools\NuGet\nuget.exe restore
When testing this locally, by navigating into the cloned folder that the pipeline creates on my machine, then executing the command with cmd prompt, the restoration succeeds with no errors. However, when I run this command on gitlab while in that same location, I get the sequence of errors for NuGet packages:
An error occurred while sending the request. Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond (ip addresss)Retrying 'FindPackagesByIdAsyncCore' for source 'https://nexus.macrix.eu/repository/pct2022/FindPackagesById()?id='Microsoft.NET.Test.Sdk'&semVerLevel=2.0.0'.
I assume this is because the packages that failed to retrieve are ones that are not found online.
The NuGet packages my project use are simply referenced through my local C drive via C:\Users\myuser\.nuget\packages
, and other than being included in my config file, there are no other references to the packages.
What is the best solution to this issue?