So we are integrating the Sonar scan for our .NET codebase in azure repos , and we established a pipeline that it scans the code and publishes the results to the sonar dashboard .
However , scan results are not visible . In the sonar dashboard it shows the .cs files but does not scan them .
Please advise how to fix this ?
Note : We are using sonar Comunnity edition for this .
Welcome to the community!
Could you elaborate on this? It’s not clear to me what is/is not happening.
Hi Ann ,
Below is the screen shot
So this is what we see in the dashboard as of now .
However in the code section we do see the files ,
So please advise how to fix this .
I wonder if analysis thinks your code is all test files. That would explain why no Lines of Code are detected (because they’re all seen as Lines of Tests).
You can read more here.
Hi Ann ,
I tried by adding the
<!-- Project is not a test project -->
in the csproj files in the codeas suggested in the articleyou shared but still the scan doesnt give any results .
Below is my pipeline for sonar scan
buildPlatform: ‘Any CPU’
echo “Updating packages …”
sudo apt-get update -y
sudo apt-get install openjdk-11-jdk -y
cliProjectName: 'E* ’
Please advise how to proceed further .
Can you share your logs, starting from the
sharing the log with . please advise further .
sonarlog2.txt (109.0 KB)
Here’s the problem:
2022-08-23T12:47:43.1190472Z WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html
You need to be using SonarScanner for .NET.