I am using the below configuration:
I want to analyze the project which has different C# modules(different .sln file) but while running,
it’s not picking up any modules as i am running above mentioned command from root directory. So how to configure sonar-scanner-msbuild for multiple solution project?
Thanks in advance!
Please provide the logs of the build and scanner end steps.
Please find the below details:
For this step
Microsoft ® Build Engine version 15.8.166+gd4e8d81a88 for .NET Framework
Copyright © Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1003: Specify a project or solution file. The current working
directory does not contain a project or solution file.
SonarScanner for MSBuild 4.3.1
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\Users\Administrator\Downloads\sonar-scan
Loading analysis properties from C:\Users\Administrator\Downloads\sonar-scanner-
The SonarQube MSBuild integration failed: SonarQube was unable to collect the re
quired information about your projects.
- The project has not been built - the project must be built in between the b
egin and end steps
- An unsupported version of MSBuild has been used to build the project. Curre
ntly MSBuild 14.0 and 15.0 are supported
- The begin, build and end steps have not all been launched from the same fol
- None of the analyzed projects have a valid ProjectGuid and you have not use
d a solution (.sln)
sonar-project.properties files are not understood by the SonarScanner for MSBuil
d. Remove those files from the following folders: C:\Users\Administrator\Desktop
15:04:07.907 Creating a summary markdown file…
15:04:07.909 Post-processing failed. Exit code: 1
Well as the build step is saying you are not building anything so of course the analysis cannot succeed. Please fix your build step.
Thanks for your response! While building it is looking for sln file and as i have already mentioned my project has multiple sln file in different modules so that’s why i am trying from root folder. I tried to build each module seperately but that will create seperate project in sonarqube that i don’t want. While exploring i got to know that msbuild-scanner doesn’t support multiple sln files for same project so can you please help?
I have some trouble to follow you… It would be nice to have some example to understand the scenario you are trying to describe.
This is what I got:
And you want to analyze all the solutions onto the same SonarQube project.
If that’s the case then that’s just a classic msbuild way (nothing specific to SonarQube):
1/ SonarScanner.MSBuild.exe begin …
2/ msbuild /t:rebuild ./solution1/solution1.sln
3/ msbuild /t:rebuild ./solution1/solution2.sln
4/ SonarScanner.MSBuild.exe end …
@Ammo Thank you for your response. Yup definitely this will works as we can refer multiple solution while building. Thanks