Application Stack
- Jenkins
- .NET 4.7
- SonarQube 7.4
- Bitbucket (Source control)
- VS 2015 Update 3
- VsTest to execute UnitTest
Path of Msbuid in Global Tools Configuration is
- C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe
- Also tried with C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Msbuild.exe
We have created sample project and configured all in one server.
We can see multiple kind of errors in log files like
- Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
- WARNING: File 'C:\Program Files (x86)\Jenkins\workspace\CICD\UnitTestProject1\Properties\AssemblyInfo.cs' is not located under the root directory 'C:\Program Files (x86)\Jenkins\workspace\CICD.sonarqube\out' and will not be analyzed
- No analysable projects were found. SonarQube analysis will not be performed
- This only comes when i use msbuild from "Program files" An instance of analyzer SonarAnalyzer.Rules.CSharp.FieldsShouldNotBePublic cannot be created from C:\Users\manish.joisar\AppData\Local\Temp.sonarqube\resources\0\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
I can see message with build succeeded.
I can also see successful test run message Total tests: 1. Passed: 1. Failed: 0. Skipped: 0. Test Run Successful.
Sonar configuration is done in build configuration under "Execute Sonar scanner" step
I am not sure what is missing here, wrong configuration, wrong msbuild ??