© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago•
8 replies
NykyTV

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:

stages:
  - install
  - build

install-job:
  stage: install
  script:
    - apt-get update
    - apt-get install sudo
    - apt-get install curl -y
    - apt-get install wget -y
    - chmod +x dotnet-install.sh
    - sudo ./dotnet-install.sh --runtime dotnet --version 8.0.0
  tags:
    - .net
    - c#

build-job:
  stage: build
  script:
    - dotnet --version
    - echo "Compiling the code..."
    - dotnet build
    - echo "Compile complete."
  tags:
    - .net
    - c#
stages:
  - install
  - build

install-job:
  stage: install
  script:
    - apt-get update
    - apt-get install sudo
    - apt-get install curl -y
    - apt-get install wget -y
    - chmod +x dotnet-install.sh
    - sudo ./dotnet-install.sh --runtime dotnet --version 8.0.0
  tags:
    - .net
    - c#

build-job:
  stage: build
  script:
    - dotnet --version
    - echo "Compiling the code..."
    - dotnet build
    - echo "Compile complete."
  tags:
    - .net
    - c#


build-job error:
$ dotnet --version
/bin/bash: line 147: dotnet: command not found
$ dotnet --version
/bin/bash: line 147: dotnet: command not found


I have been looking for solutions for over 2 hours now, but nothing has worked. Can anyone help me?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

problem with docker installation for .Net
C#CC# / help
17mo ago
❔ Enforcing dotnet format in CI/CD
C#CC# / help
3y ago
❔ [Compiler Help] [GitLab CI/CD]
C#CC# / help
4y ago
Docker - NanoServer - Dotnet with PowershellCore
C#CC# / help
3y ago