SAST analyzer error with .NET - Unable to build project using `dotnet`
Summary
So I have exactly the same problem as #300368 (closed) already described:
Using the SAST CI template with a .NET project produces "Unable to build project using dotnet
".
Steps to reproduce
New Repo
Create dotnet project
Create CI/CD job:
stages:
- test
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
Job fails.
Example Project
Project with two jobs: build, which successfully executes dotnet build
, and the included SAST job.
Link goes directly to the failing job:
https://gitlab.com/Regenhardt/custom-vision-lib/-/jobs/1943170953
What is the current bug behavior?
Job fails, producing "Unable to build project using dotnet
"
What is the expected correct behavior?
Job should analyse the project.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
Tried adding a before_script to the SAST job installing dotnet-sdk-6.0 as mentioned as a workaround in the previous issue, but it just fails since neither apt nor apt-get can be found.