SonarScanner.MSBuild.exe and build-wrapper-win-x86-64.exe

Hello,

I’m using sonar-scanner-msbuild-4.6.2.2108-net46 and build-wrapper-win-x86 to run the analysis for my source which have many project and many solutions.
Per documentation did the analysis by following steps and it did worked.

SonarScanner.MSBuild.exe begin /k:"cs-and-cpp-project-key" /n:"My C# and C++ project" /v:"1.0" /d:sonar.cfamily.build-wrapper-output="bw_output"
build-wrapper-win-x86-64.exe --out-dir bw_output MSBuild.exe /t:Rebuild
SonarScanner.MSBuild.exe end

Since I have many projects and solutions is it possible to have following step to analyze between begin and end?
When I tried it certainly analyze the last build only. So please confirm if this way is possible if yes what should have missing for me to get this worked.

SonarScanner.MSBuild.exe begin /k:“cs-and-cpp-project-key” /n:“My C# and C++ project” /v:“1.0” /d:sonar.cfamily.build-wrapper-output=“bw_output”
build-wrapper-win-x86-64.exe --out-dir bw_output MSBuild.exe /t:Rebuild
build-wrapper-win-x86-64.exe --out-dir bw_output MSBuild.exe /t:Rebuild
build-wrapper-win-x86-64.exe --out-dir bw_output MSBuild.exe /t:Rebuild
SonarScanner.MSBuild.exe end

Hello @anuragvelekkattu,

You can try to write one script that build your 3 projects and pass it once to build-wrapper:

SonarScanner.MSBuild.exe begin /k:“cs-and-cpp-project-key” /n:“My C# and C++ project” /v:“1.0” /d:sonar.cfamily.build-wrapper-output=“bw_output”
build-wrapper-win-x86-64.exe --out-dir bw_output YourBuildScript
SonarScanner.MSBuild.exe end

Let me know if it works!

@Abbas_Sabra thanks for your thoughts here.

I did similar thing before submitting the post above. Unfortunately it didn’t work. The only diff is that instead of any script, I do have a custom exe which read through the list of components need to build and spawn MSBuild under the hood. While trying I got following error at the last step.