Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
Not an error result from pull request scan is different from azure devops scan
Result from sonar scan from azure devops CI is different from scan result from gitlab. …
Azure uses msbuild quite alright and gitlab uses the sonarsource image
Is there a way to configure gitlab to use msbuild and how do i do it?
Just before i try the approach you shared. … one question
Does this scan only the new code or the entire project.
Also, another question on mono repos. … what do you advice and how do you expect mono repos to be handled from gitlab?
is it with a single project in sonarcloud or with different projects especially when dealing with a mono repo of microservices as that’s most how our projects are structured.
The entire project will be scanned, but in some cases caching can prevent unchanged parts of the project from being reanalyzed (in the case of Pull Request analysis, for example).
How do you normally build your code? With many separate build commands (selectively building parts of the repo based on what changed), or just one? If it’s the former, I’d suggest a monorepo. If it’s the latter, a single SonarCloud project works fine.
Please see below result of the commands you suggested to run
$ dotnet tool install --global dotnet-sonarscannerTools directory '/root/.dotnet/tools' is not currently on the PATH environment variable.If you are using bash, you can add it to your profile by running the following command:cat << \EOF >> ~/.bash_profile# Add .NET Core SDK toolsexport PATH="$PATH:/root/.dotnet/tools"EOFYou can add it to the current session by running the following command:export PATH="$PATH:/root/.dotnet/tools"You can invoke the tool using the following command: dotnet-sonarscannerTool 'dotnet-sonarscanner' (version '6.2.0') was successfully installed.$ dotnet sonarscanner begin /k:"<project key>" /d:sonar.login="$SONAR_TOKEN"Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-sonarscanner does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.Could not execute because the specified command or file was not found. Cleaning up project directory and file based variables 00:00ERROR: Job failed: exit code 1