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!
MSBUILD : error MSB1003: Specify a project or solution file. The current working
directory does not contain a project or solution file.
For this SonarScanner.MSBuild.exe end
output:
C:\Users\Administrator\Desktop\Analyzer1\Analyzer1\staging\src>SonarScanner.MSBu
ild.exe end
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
ner-msbuild-4.3.1.1372-net46\SonarQube.Analysis.xml
Loading analysis properties from C:\Users\Administrator\Downloads\sonar-scanner-
msbuild-4.3.1.1372-net46\SonarQube.Analysis.xml
Post-processing started.
The SonarQube MSBuild integration failed: SonarQube was unable to collect the re
quired information about your projects.
Possible causes:
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
der
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
\Analyzer1\Analyzer1\staging\src
15:04:07.907 Creating a summary markdown file…
15:04:07.909 Post-processing failed. Exit code: 1
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?
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 …