Search code examples
c#msbuildsonarqubejenkins-pipelinesonarqube-scan

SonarQube takes only on csproj to do the anlyse from SLN


I want to run the SonarQube analyse on my sln files meaning, all the csproj included into that file. Apparently I am missing one point in the configuration because my scanner will only takes one csproj (always the same)

This is how I use my command line

E:\SonarQube\bin\SonarQube.Scanner.MSBuild.exe  begin /k:"MySuperProjectKey" /n:"MySuperName" /v:"1.0"

Then I am doing the build with msbuild tools (no visual studio involved)

'"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" /t:Rebuild  /p:Configuration=dev MySuperVSProjectWithPlentyOfCSPROJ.sln"'

Then ending it normaly

"E:\SonarQube\bin\SonarQube.Scanner.MSBuild.exe end"

At the end of the day there is only one C# sharelibrary project analysed on my SonarQube website instead of 10 or more.


Solution

  • I have to use the SonarScanner.MSBuild.exe instead of the SonarQube.Scanner.MSBuild.exe All my csproj are now on my dashboard.