.cs files not scanned in .NET framewok 4.6.1 project

We are using SonarCloud/BitBucket pipelines to scan our projects and cannot get .cs files to be included in the Line of Code.

The analysis scope of the project has all fields empty apart from the exclusion of two files which are recorded as **/file1.php and **file2.aspx
The languages section of the project has sonar.cs.file.suffixes has a single entry of .cs

We can see other file types being scanned; HTML, JavaScript, CSS, XML and TSQL - just not CS files.

Here is the bitbucket-pipelines.yml file:

image: atlassian/default-image:2

pipelines:
  branches:
    "{master}":
      - step:
          name: SonarCloud Analysis
          services:
            - docker

          script:
            - pipe: sonarsource/sonarcloud-scan:1.2.1
              variables:
                SONAR_TOKEN: ${SONAR_TOKEN}
                SONAR_SCANNER_OPTS: -Xmx1024m
                DEBUG: ${SONAR_DEBUG}
                EXTRA_ARGS: -Dsonar.verbose=${SONAR_VERBOSE} -Dsonar.projectKey=**** -Dsonar.organization=**** -Dsonar.projectVersion=${BITBUCKET_COMMIT}

definitions:
  services:
    docker:
      memory: 3072

Any assistance on getting the CS files included would be greatly appreciated.

Hi @dibbdob

You need to use the SonarScanner for .NET to achieve that.

You can read an example here : Bitbucket Pipe + SonarCloud + C#/.net core

Let us know.
Mickaël

1 Like

Hi, laughed at your response - only because you referred me to a post that I’ve previously solved - my memory must be failing me big time!

Anyway, thanks for the reminder!

Ah, i didn’t see it at first too ! That’s fun !

Hope that helps then.

Mickaël