Problem with the dotnet installation in gitlab-ci (Docker, Debian11)
im using the official dotnet-install.sh script in the install stage
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
this is my current .gitlab-ci.yml:
build-job error:
I have been looking for solutions for over 2 hours now, but nothing has worked. Can anyone help me?
8 Replies
You need to either use artifacts or caches to cache your installation. Your two jobs can be run on different agents so the installation doesn't automatically carry over.
As a quick fix, just move the dotnet installation inside the build job and then it'll work
i already tried to put everything in one job but it doesn't work
It has to work. I've never used gitlab but I've set up GitHub actions, which should basically be the same thing. If the installation succeeds, I've never seen it not be able to run.
But regardless, can you check if there's already agents with existing dotnet installations, so you don't have to do your own installation?
https://stackoverflow.com/a/52321137
Stack Overflow
Build .NET solution using GitLab CI Pipeline
I have a solution with several .NET projects in it. I use GitLab, not self-hosted, for version control and would like to start using their CI tools as well. I have added the following .gitlab-ci.ym...
Also maybe the dotnet installer is not made for agents? I have some very vague recollection about some specific dotnet installer for build agents, you can try to search for that as well
i installed now the mono:latest image and it seems to run and install without the installer. But now there is this error while building with 'dotnet build':
error NETSDK1178: The project depends on the following workload packs that do not exist in any of the workloads available in this installation: Microsoft.iOS.Sdk.net8.0_18.0
and
error NETSDK1178: You may need to build the project on another operating system or architecture, or update the .NET SDK.
You need some specific workload, but idk what.
Try to figure out what workload you need and try to install it in your job
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install
dotnet workload install command - .NET CLI
The 'dotnet workload install' command installs optional workloads.
yeah this is my workload install command
i added maui-ios because of the 1st error: Microsoft.iOS.Sdk.net8.0_18.0
the installation works without the maui-ios but i guess ill need it.
this is the error message from the job:
Workload installation failed: Workload ID maui-ios isn't supported on this platform.
do you have any other ideas which platform/image could work?
Tbh no because I don't use gitlab, but maybe they have a Maui image. Could you try to find their image repository? It should be documented somewhere