Issue with Analyzing Multi-Language Codebase (C# (Dotnet) and Angular) in SonarQube - Only TypeScrip

I am experiencing an issue while analyzing a multi-language codebase (C# and Angular) using SonarQube. Despite configuring the sonar-scanner to include both .ts and .cs files, the analysis results only include TypeScript (Angular) results, with no data for C# files.

sonar-scanner \
  -Dsonar.projectKey=${SONAR_PROJECT_KEY} \
  -Dsonar.qualitygate.wait=true \
  -Dsonar.sources= .. \
  -Dsonar.inclusions=**/*.ts,**/*.cs \
  -Dsonar.host.url=${SONAR_HOST_URL} \
  -Dsonar.login=${SONAR_TOKEN} \
  -Dsonar.exclusions=**/node_modules/**,**/*.scss,**/*.html,**/*.js,**/*.json,**/*.svg,**/*.txt,**/*.sln,**/*.ttf,**/*.spec.ts \
  -Dsonar.cs.opencover.reportsPaths=./TestResults/*/coverage.opencover.xml 

is there any alternate method which can helps to get both code results in same Sonar Project…?

Hi,

Welcome to the community!

To analyze C# files, you’ll need to use the SonarScanner for .NET.

 
HTH,
Ann

Hi Thanks for Responding…
I have gone through the Doc But It didn’t work in one Run of execution I needs to get result of Dotnet& Angular Result …is it possible …?
I am using Docker executer through GitLab

Hi @sailesh,

You can only analyze a .Net project with the Scanner For .NET.
Thankfully, we recently published version 8 (8.0.2 at this time) of the Scanner For .NET for this exact use case. It will automatically find your Typescript project.

If you follow the instructions under Ann’s link, and you make sure you run the scanner from the root of your repository it should find all your files.

Please let us know if something if this works for for you or not!

Denis

Hi

After adding this sonar.qualitygate.wait=true in command it started but one Problem
when ever I made it default job for on Merge Request I am not able to see result …but if I run sonar job manually its working I mean I am able to see the data