we can’t analyze a C# project, we’ve tried several times following the guide we’ve found here:
and using “Classic” .NET Framework Invocation, nevertheless we obtain the same result: The main branch of this project is empty.
SonarQube version is 220.127.116.11424
Scanner versioni is “SonarScanner for MSBuild 5.5.3”
May someone help us?
Could you share your full analysis log?
in attachment you’ll find the logs.
Problematiche CSharp.zip (11.8 KB)
Thanks for sharing your logs. When I look at
sonar_build.log I see a lot of references to
.csproj files, but no(?)
By default, analysis recognizes files with a
.cs extension as C# code files. If you’re using a non-standard extension, you’ll need to tell SonarQube what to look for. You can do that at the global or project level via the UI ([Global] Administration → Languages → C# → File suffixes, or Project Settings → General Settings → Languages → (&etc). You could also pass this as an analysis property, but IMO the UI is the better course here.
the project contains files with a .cs extension. The .csproj file list them. Sonar see them as you can see in the attached image.
Please, let me know.
Cattura.zip (18.6 KB)
Given that your project has “Test” in the name, I suspect it’s being treated as a test project & thus no “Lines of Code” are detected (instead, they’re seen as lines of test code). This may help.