From SonarQube 7.7 to 8.2 no issues found with sonarscanner msbuild

Hi,

I’m Luca and before now I solved all the issue only searching on the web.
Migrating from SonarQube 7.7 -> SonarQube 8.2 i found a little problem may be dealing with SonarScanner MSBuild.

  • SonarQube 8.2
  • SonarScanner MSBuild 4.1.0.1829
  • Java 11.0.5 Oracle Corporation (64-bit)
  • Windows 10 10.0 amd64
  • C# project

I have a C# project correctly analyzed with SonarQube 7.7 reporting
all the bugs and open issue. The same project is analyzed by SonarQube 8.2 with 0 bugs, 0 vulnerability, 0 …
I found many bugs an vulnerability in the stdout, but finally the .cs files are skipped as you can see from the logs:

SonarScanner for MSBuild 4.7.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\Proteo\ProteoModel.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\Proteo\ProteoModel.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\ProteoSchemaOrario\ProteoSchemaOrarioModel.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\ProteoSchemaOrario\ProteoSchemaOrarioModel.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\T3MF\T3MF_Model.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\T3MF\T3MF_Model.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
The SONAR_SCANNER_HOME environment variable is not required and will be ignored.
Calling the SonarQube Scanner...
INFO: Scanner configuration file: C:\sonar-scanner-msbuild-4.7.1.2311-net46\sonar-scanner-4.1.0.1829\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\sonar-project.properties
INFO: SonarQube Scanner 4.1.0.1829
INFO: Java 11.0.5 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\user\.sonar\cache
INFO: SonarQube server 8.2.0
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=133ms
INFO: Server id: B5316926-AXGCmBU51FJ_hQfczZLA
INFO: User cache: C:\Users\user\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=49ms
INFO: Load/download plugins (done) | time=145ms
INFO: Process project properties
INFO: Process project properties (done) | time=48ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=44ms
INFO: Project key: T3.Core.V1.Microservice
INFO: Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
INFO: Working dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\.sonar
INFO: Load project settings for component key: 'T3.Core.V1.Microservice'
INFO: Load project settings for component key: 'T3.Core.V1.Microservice' (done) | time=14ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=36ms
INFO: Detected Gitlab CI
INFO: Load active rules
INFO: Load active rules (done) | time=435ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Indexing files of module 'T3.Core.V1.Microservice'
INFO:   Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
INFO:   Source paths: MediaFactorry/Enums.cs, Process/AciT3MF.cs, Commons.cs, DataA...
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\Enums.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\AciT3MF.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Commons.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataAdapter.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataModel.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Function.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataContract.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\AspidCallBack.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\Proteo.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\ReceiveMediaVerification.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\T3Mam.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\Ticket.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proteo\DataContract.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proteo\WebRequest.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\Galaxy.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\IcpAD.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\IcpFileUtility.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\icpIDGenerator.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\Solr.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\T3MF_Business.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\SubTitle\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\MessaInOnda\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\RaiCom\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\TgrWeb\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\SendAsset.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Service.svc.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\IService.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Properties\AssemblyInfo.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\BaseTypes.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\ComplexTypes.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\MainTypes.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\Messages.cs' does not have encoding information. Skip it.
INFO: Indexing files of module 'T3.Core.V1.Microservice'
INFO:   Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
INFO: 157 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module T3.Core.V1.Microservice
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=22ms
WARNING: WARNING: An illegal reflective access operation has occurred
WARNING: WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/user/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor XML Sensor [xml]
INFO: 14 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=16ms
INFO: Sensor XML Sensor [xml] (done) | time=444ms
INFO: 14/14 source files have been analyzed
INFO: ------------- Run sensors on module T3.Core.V1.Microservice
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=5ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 97ms, dir size=204 KB
INFO: Analysis report compressed in 168ms, zip size=51 KB
INFO: Analysis report uploaded in 32ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube.prodtv.rai.it/dashboard?id=T3.Core.V1.Microservice
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarqube.prodtv.rai.it/api/ce/task?id=AXGYy1ujNTot1pN0ESPD
INFO: Analysis total time: 4.252 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.966s
INFO: Final Memory: 13M/54M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner has finished
20:13:16.441  Post-processing succeeded.

How can i solve this problem?
I tried to fix the encoding in the sonar.sourceEncoding to utf-8 but it was unuseful.

Bye,
Luca

Hi,

I’m Luca and may be I have the same problem.
It seems that the SonarScanner MSBuild has problem with the .cs files encoding and the Sensor c# not appear in the logs.

SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 4.7.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\Proteo\ProteoModel.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\Proteo\ProteoModel.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\ProteoSchemaOrario\ProteoSchemaOrarioModel.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\ProteoSchemaOrario\ProteoSchemaOrarioModel.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\T3MF\T3MF_Model.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\T3MF\T3MF_Model.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
The SONAR_SCANNER_HOME environment variable is not required and will be ignored.
Calling the SonarQube Scanner...
INFO: Scanner configuration file: C:\sonar-scanner-msbuild-4.7.1.2311-net46\sonar-scanner-4.1.0.1829\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\sonar-project.properties
INFO: SonarQube Scanner 4.1.0.1829
INFO: Java 11.0.5 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\user\.sonar\cache
INFO: SonarQube server 8.2.0
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=137ms
INFO: Server id: B5316926-AXGCmBU51FJ_hQfczZLA
INFO: User cache: C:\Users\user\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=50ms
INFO: Load/download plugins (done) | time=144ms
INFO: Process project properties
INFO: Process project properties (done) | time=37ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=57ms
INFO: Project key: T3.Core.V1.Microservice
INFO: Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
INFO: Working dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\.sonar
INFO: Load project settings for component key: 'T3.Core.V1.Microservice'
INFO: Load project settings for component key: 'T3.Core.V1.Microservice' (done) | time=16ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=42ms
INFO: Detected Gitlab CI
INFO: Load active rules
INFO: Load active rules (done) | time=579ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Indexing files of module 'T3.Core.V1.Microservice'
INFO:   Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
INFO:   Source paths: MediaFactorry/Enums.cs, Process/AciT3MF.cs, Commons.cs, DataA...
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\Enums.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\AciT3MF.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Commons.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataAdapter.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataModel.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Function.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataContract.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\AspidCallBack.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\Proteo.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\ReceiveMediaVerification.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\T3Mam.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\Ticket.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proteo\DataContract.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proteo\WebRequest.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\Galaxy.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\IcpAD.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\IcpFileUtility.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\icpIDGenerator.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\Solr.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Proxy\T3MF_Business.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\SubTitle\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\MessaInOnda\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\RaiCom\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Schema\TgrWeb\Metadata.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Process\SendAsset.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Service.svc.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\IService.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\Properties\AssemblyInfo.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\BaseTypes.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\ComplexTypes.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\MainTypes.cs' does not have encoding information. Skip it.
WARN: File 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\MediaFactorry\Messages.cs' does not have encoding information. Skip it.
INFO: Indexing files of module 'T3.Core.V1.Microservice'
INFO:   Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
INFO: 157 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module T3.Core.V1.Microservice
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=21ms
WARNING: WARNING: An illegal reflective access operation has occurred
WARNING: WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/user/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor XML Sensor [xml]
INFO: 14 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=18ms
INFO: Sensor XML Sensor [xml] (done) | time=462ms
INFO: 14/14 source files have been analyzed
INFO: ------------- Run sensors on module T3.Core.V1.Microservice
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=5ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 99ms, dir size=204 KB
INFO: Analysis report compressed in 168ms, zip size=51 KB
INFO: Analysis report uploaded in 33ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube.prodtv.rai.it/dashboard?id=T3.Core.V1.Microservice
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarqube.prodtv.rai.it/api/ce/task?id=AXGdJuJ5L1YxVljC21k8
INFO: Analysis total time: 4.402 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 6.139s
INFO: Final Memory: 13M/54M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner has finished
16:31:43.585  Post-processing succeeded.
Job succeeded

Bye,
Luca

Hi there.

I’ve moved your comment to a new thread but then found you’ve already made a topic for your issue, so I’ve moved it here! It looks like a separate issue from the one in the thread you posted on.

What file encoding is being used by the files that are being ignored?

For example:

WARN: File ‘C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\DataContract.cs’ does not have encoding information. Skip it.

Thanks a lot,

the files are UTF-8 encoded. I tried to force the encoding with sonar.sourceEncoding=utf-8 and the result was the same.

In the logs y can see the encoding used for the source files:

INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)

This is the logs with SonarQube 7.7:

    SonarScanner.MSBuild.exe end
    SonarScanner for MSBuild 4.6
    Using the .NET Framework version of the Scanner for MSBuild
    Post-processing started.
    WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\Proteo\ProteoModel.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
    WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\Proteo\ProteoModel.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
    WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\ProteoSchemaOrario\ProteoSchemaOrarioModel.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
    WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\ProteoSchemaOrario\ProteoSchemaOrarioModel.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
    WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\T3MF\T3MF_Model.Context.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
    WARNING: File 'C:\Users\user\.nuget\packages\t3.business.library\1.1.5\contentFiles\any\net461\Model\T3MF\T3MF_Model.tt' is not located under the root directory 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2' and will not be analyzed.
    The SONAR_SCANNER_HOME environment variable is not required and will be ignored.
    Calling the SonarQube Scanner...
    INFO: Scanner configuration file: C:\sonar-scanner-msbuild-4.6.0.1930-net46\sonar-scanner-3.3.0.1492\bin\..\conf\sonar-scanner.properties
    INFO: Project root configuration file: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\sonar-project.properties
    INFO: SonarQube Scanner 3.3.0.1492
    INFO: Java 1.8.0_201 Oracle Corporation (64-bit)
    INFO: Windows 10 10.0 amd64
    INFO: User cache: C:\Users\user\.sonar\cache
    INFO: SonarQube server 7.7.0
    INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
    INFO: Load global settings
    INFO: Load global settings (done) | time=90ms
    INFO: Server id: BF41A1F2-AWoRaN-mshtc0ZwWaQ-e
    INFO: User cache: C:\Users\user\.sonar\cache
    INFO: Load/download plugins
    INFO: Load plugins index
    INFO: Load plugins index (done) | time=48ms
    INFO: Load/download plugins (done) | time=87ms
    INFO: Process project properties
    INFO: Execute project builders
    INFO: Execute project builders (done) | time=57ms
    INFO: Project key: T3.Core.V1.Microservice
    INFO: Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
    INFO: Working dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\.sonar
    INFO: Load project settings for component key: 'T3.Core.V1.Microservice'
    INFO: Load project settings for component key: 'T3.Core.V1.Microservice' (done) | time=16ms
    INFO: Load project repositories
    INFO: Load project repositories (done) | time=148ms
    INFO: Load quality profiles
    INFO: Load quality profiles (done) | time=70ms
    INFO: Load active rules
    INFO: Load active rules (done) | time=1729ms
    INFO: Indexing files...
    INFO: Project configuration:
    INFO: Indexing files of module 'T3.Core.V1.Microservice'
    INFO:   Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
    INFO:   Source paths: MediaFactorry/Enums.cs, Process/AciT3MF.cs, Commons.cs, DataA...
    INFO: Indexing files of module 'T3.Core.V1.Microservice'
    INFO:   Base dir: C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2
    INFO: 181 files indexed
    INFO: 0 files ignored because of scm ignore settings
    INFO: Quality profile for cs: Sonar way
    INFO: Quality profile for xml: Sonar way
    INFO: ------------- Run sensors on module T3.Core.V1.Microservice
    INFO: Load metrics repository
    INFO: Load metrics repository (done) | time=20ms
    INFO: Sensor JaCoCo XML Report Importer [jacoco]
    INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
    INFO: Sensor C# Properties [csharp]
    INFO: Sensor C# Properties [csharp] (done) | time=6ms
    INFO: Sensor JavaXmlSensor [java]
    INFO: Sensor JavaXmlSensor [java] (done) | time=4ms
    INFO: Sensor HTML [web]
    INFO: Sensor HTML [web] (done) | time=15ms
    INFO: Sensor XML Sensor [xml]
    INFO: 13 source files to be analyzed
    INFO: Sensor XML Sensor [xml] (done) | time=567ms
    INFO: 13/13 source files have been analyzed
    INFO: ------------- Run sensors on module T3.Core.V1.Microservice
    INFO: Sensor JaCoCo XML Report Importer [jacoco]
    INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
    INFO: Sensor JavaXmlSensor [java]
    INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
    INFO: Sensor C# [csharp]
    INFO: Importing results from 6 proto files in 'C:\Gitlab-Runner\builds\150d1cf2\0\Progettazione-Software\T3-MF-Integration\T3.Api.Gateway.V1.2\.sonarqube\out\0\output-cs'
    INFO: Importing 1 Roslyn report
    INFO: Sensor C# [csharp] (done) | time=1631ms
    INFO: ------------- Run sensors on project
    INFO: Sensor Zero Coverage Sensor
    INFO: Sensor Zero Coverage Sensor (done) | time=72ms
    INFO: Calculating CPD for 31 files
    INFO: CPD calculation finished
    INFO: Analysis report generated in 215ms, dir size=2 MB
    INFO: Analysis report compressed in 2182ms, zip size=533 KB
    INFO: Analysis report uploaded in 56ms
    INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=T3.Core.V1.Microservice
    INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
    INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AXF9jGDusbzXIqfkg23Y
    INFO: Analysis total time: 10.870 s
    INFO: ------------------------------------------------------------------------
    INFO: EXECUTION SUCCESS
    INFO: ------------------------------------------------------------------------
    INFO: Total time: 12.677s
    INFO: Final Memory: 19M/629M
    INFO: ------------------------------------------------------------------------
    The SonarQube Scanner has finished
    13:14:44.49  Post-processing succeeded.
    Job succeeded

Hi,

I foud a fix with a SonarQube 8.2 c# plugin downgrade:

  • sonar-csharp-plugin-8.6.0.16497.jar -> sonar-csharp-plugin-7.11.0.8083.jar

This isn’t a solution.

Luca

Hey @LucaF89

Sorry for the delay. An expert in this area will look into this soon.

Thanks for raising this issue, @LucaF89 .

Just to better understand how to repro this… you are analyzing UTF-8 files on a system that has a different default encoding?

Indeed, we need to fix the problem. First we need to come up with a reproducer.

Hi Andrei,

yes I’m analyzing UTF-8 files.
Fixing the encoding with sonar.sourceEncoding=UTF-8
the problem continue.

With a previous version of Sonar C# plugin the problem
doesn’t exist.

Luca

Hi Luca, we’ve investigated on our side and noticed we don’t fallback on a default / provided encoding and we opened a ticket - https://github.com/SonarSource/sonar-dotnet/issues/3316

However, we would really appreciate if you could provide us more information to better understand your problem:

  • please give us the verbose output of the END step (please run SonarScanner.MSBuild.exe begin /k:"MyProject" /d:sonar.verbose=true as the BEGIN step, and please attach the output of END step)
  • please give us the file-metadata.pb files which you find in the .sonarqube\out\<NUMBER>\output-cs\ directories - the easiest is to do a ZIP archive of the .sonarqube\out folder . Please note that the .sonarqube folder gets generated during analyses and you can find it in the folder you run the commands from.

@LucaF89 I hope your are safe and well.

We could not create a reproducer. When you have some time, please give us the requested information in my message above:

Hi @LucaF89,

We’d like to address this issue, but we still cannot reproduce it.
When you build your project with Scanner for MSBuild, these files are generated:

\.sonarqube\out\<any number>\output-cs\file-metadata.pb 

Can you share these files with us please?