Nuget restore (via gitlab runner) fails at a specific package
I am trying to set up a windows gitlab runner to build and publish my WPF .NET Framework 4.8 project. My
gitlab-ci.yml
file looks as follows:
Now my project contains the following external packages:
- Microsoft.Toolkit.Uwp.Notifications/7.1.3
- PDFtoPrinter/1.5.0
- Serilog.Sinks.File
- Serilog
Now the runner can successfully restore all the package EXCEPT the first one (Notifications). I have even, as you can see, specifically added the package through the script. It definitely is available on the nuget source. On my local machine (Windows 11, Rider) there is not a single problem with restore and build.
Does anyone have any idea why my windows runner fails at restoring this specific package?4 Replies
It does not matter whether I specifically add the packge in the script or not. Both cases generate the same error
using
nuget.exe
is not really recommended anymore
is your project an SDK-style project? like, do you have <Project Sdk="Microsoft.NET.Sdk">
as the first line, or is it the uglier formatNo, it is the old, ugly version. Also I got some more insight.
It is specifically the package Microsoft.Toolkit.Uwp.Notifications/7.1.3 that is failing. The verbose log of the runner says that it could not be found at the location where the nuget packages are downloaded to. The thing is... it is there. I checked the location on the server and the package is there. Is has the same permissions etc as all the other packages which work.
Also, when going to the solution location where the runner downloads the git repo to, open a powershell prompt there and go "nuget restore", it works perfectly fine. It finds all the packages and restores them.
ok. so, in general, i would suggest changing to the new format if you could, it works even with WPF on .NET 4.8, and it will bring benefits (like, better performance and more modern features in visual studio, ability to use
dotnet
commands, etc.)
if you cannot... do you have a packages.config
file in your repo, or are you using PackageReference