Sonar Qube analysis failing for C# project that uses Cswin32 as a dependency

We’re using Cswin32 to generate Win32 API projections for our codebase. It works as an analyzer using the SourceGenerator feature.

It works great when building from CLI or Visual Studio. The problem is when we use it together with SonarQube in TFS pipeline, somehow, the final command to be executed “dotnet exec” does not include the “/analyzer:” for the Cswin32, it only include SonarQube Analyzers.

Accordig to SonarQube documentation we used the following steps:

dotnet tool install --global dotnet-sonarscanner --version 5.10.0
dotnet sonarscanner begin /k:"project-key" /d:sonar.login="<token>"
dotnet build <path to solution.sln>
dotnet sonarscanner end /d:sonar.login="<token>"

Just to make it clear, we already have a working setup for SonarQube for TFS(2018), but i was giving some errors and we thought it was because of the outdated version, turns out it’s not.

Does someone else have faced this problem or a similar one? If we could tell SonarQube to use the project analyzers as well as it’s own, that should do the trick. But we’re open to other solutions.


Welcome to the community!

I kinda doubt it’s relevant, but what version of SonarQube are you running?