Hi,
I am struggling to get SonarCloud to analyse my project folder for both .Net C# and TSQL files. I can either run the MSBUILD scanner, or the Sonar Scanner. MSBUILD correctly analyses the solution and project files; but does not analyse the TSQL files.
If I use the Sonar Scanner, it will find the TSQL files but does not analyse the solution anymore.
How do I combine these two analyses? I would prefer not to have to create two separate build pipelines in Azure for this.
Some further details;
-
Azure Devops (pipeline and git)
-
Scanner command (azure pipeline)
- task: SonarCloudPrepare@1
displayName: ‘Prepare .Net Solution analysis configuration’
inputs:
SonarCloud: ‘Sonar Cloud (tradared)’
organization: ‘tradared’
scannerMode: ‘MSBuild’
projectKey: ‘tradared’
projectName: ‘tradared’
- task: SonarCloudPrepare@1
OR
- task: SonarCloudPrepare@1
displayName: 'Prepare TSQL analysis configuration'
inputs:
SonarCloud: 'Sonar Cloud (tradared)'
organization: 'tradared'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'tradared'
cliProjectName: 'tradared'
cliSources: '.'
- Languages within the repository: C#, TSQL (although named .sql & .tsql)
- the potential workaround I see would be to create a second project in SonarCloud and have it operating with a specific Sonar Scanner CLI task, as well as the MSBUILD scanner on a different project.