Analysis results are not getting loaded for .NET project

sonarqube
msbuild

(Lakshman) #1

Getting the below error when executing the analysis for a .NET project

Analyzer working directory does not exist: ‘C:\Program Files (x86)\Jenkins\workspace\F2_SQ.sonarqube\out\1\output-cs’. Analyzer results won’t be loaded from this directory.

sonarqube-6.7.6 | sonar-scanner-msbuild-4.5| msbuild 14 | .NET Framework 4.6.7 | SonarC# 7.10

Please assist us


(Valeri Hristov) #2

Hi @Lakshman, could you please run the analysis one more time with /d:sonar.verbose=true specified on the begin step of the analysis and then send us the full logs from begin, end and the compilation steps (e.g. msbuild)?

If the files are too big or you don’t want to be publicly downloadable you could use this DropBox file request:


(Abdul Khadar Azeez) #3

Hi @Val, I work along with Lakshmana and have uploaded the full log file in Drop Box. The analysis says success and the SonarQube results shows that it scanned only 31 lines of XS code, nothing related to C# files with no bugs and vulnerabilities.


(Valeri Hristov) #4

Hi @ABDUL_KHADAR_AZEEZ,

Thanks for the logs. They contain messages like:

CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.MutableFieldsShouldNotBePublicReadonly cannot be created from E:\TEMP\TEMPFILES\.sonarqube\resources\3\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. 

which means that the C# compiler (e.g. Roslyn) version is not supported. You need to use MSBuild.exe that comes with Visual Studio 2015 Update 3 (or Visual Studio 2017 any update).

The MSBuild.exe version is printed when you execute it.


(Abdul Khadar Azeez) #5

Hi @Val - Thanks for your guidance and help, the issue is resolved by one of my team member Rohitha after she re-installed VS 2017 and updated the msbuild path in jenkins pipeline.