SonarScanner .NET mandatory properties for 'Unknown'

scanner
dotnet

(Hussain Mansoor) #1

Hi,
I have .NET Framework 4.5 project which uses MSBuild 14.0. My project root directory has SonarQube.Analysis.xml file with following values

<Property Name="sonar.login">61e78ad1eec5069b2dc6910eecdb35c8d2f12194</Property>
<Property Name="sonar.password"></Property>
<Property Name="sonar.projectName">OBH</Property>
<Property Name="sonar.projectVersion">1.0</Property>
<Property Name="sonar.exclusions">**/*.xml,**/*.html,**/*.css</Property>
<Property Name="sonar.projectKey">OBH</Property>
 <Property Name="sonar.sources">**/Maxis.Enterprise.Web/*</Property>

When I execute from CLI I get You must define the following mandatory properties for ‘Unknown’: sonar.projectKey, sonar.sources

My version for sonar-scanner is:

INFO: Scanner configuration file: C:\MS_SonarQube\sonar-scanner-msbuild-4.0.2.892\sonar-scanner-3.0.3.778\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_152 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64

Logs from command is attached below:
sonarLogs.txt (12.7 KB)

Please share what is the thing I’m missing. I assume putting mandatory properties in the .xml file should be visible to Scanner.