# SonarQube is not picking the .cs file and not analyzing it

**URL:** <https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, dotnet\
**Created:** [September 5, 2023, 12:50pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664 "2023-09-05T12:50:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 5, 2023, 12:50pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/1 "2023-09-05T12:50:41Z")

</div>

stage(‘SonarQube Analysis’) {  
steps {  
script {  
env.SONAR\_RUNNER\_HOME = env.SONAR\_SCANNER\_HOME  
}

```
            bat "\"${SONAR_SCANNER_HOME}\\bin\\sonar-scanner.bat\" -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.sources=. -Dsonar.language=cs -Dsonar.host.url=${SONAR_HOST_URL}"
        }

```

This is my pipeline script, but I am not sure why this is excluding the .cs file in my project folder.

SonarScanner for MSBuild version : sonar-scanner-msbuild-5.13.1.76110-net46\SonarScanner.MSBuild.exe

I have uninstalled c# analyzer in SonarQube UI and later I couldn’t able to find it to install the plugin.

Please help me for these cs is not getting analyzed and c# plugin is not able to install issues. Thank you

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 5, 2023, 1:02pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/2 "2023-09-05T13:02:35Z")

</div>

> [@Karthi\_Niranjan\_K\_S](#):
>
> I have uninstalled c# analyzer in SonarQube UI and later I couldn’t able to find it to install the plugin.

That sounds like something you shouldn’t be able to do since a **long** time. What version of SonarQube are you using?

---

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 5, 2023, 5:24pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/3 "2023-09-05T17:24:43Z")

</div>

Hi Colin,

I was using \* Community Edition \* Version 8.3 (build 34182)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 6, 2023, 6:45am UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/4 "2023-09-06T06:45:01Z")

</div>

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

> 8.3 → 8.9.10 → 9.9.1 → 10.1 (last step optional)

You may find these resources helpful:

- [Upgrade Guide](https://docs.sonarqube.org/latest/setup/upgrading/)
- [LTS-to-LTS Upgrade Notes for 7.9 to 8.9](https://docs.sonarqube.org/8.9/setup/lts-to-lts-upgrade-notes/)
- [LTS to LTS release upgrade notes for 8.9 to 9.9](https://docs.sonarqube.org/9.9/setup-and-upgrade/lts-to-lts-release-upgrade-notes/)

If you have questions about upgrading, feel free to open a new thread for that [here](https://community.sonarsource.com/c/sq/9-9-lts-upgrade/47).

If your issue persists after upgrade, please come back to us.

---

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 6, 2023, 6:00pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/5 "2023-09-06T18:00:50Z")

</div>

I have upgraded till 9.9.1- community edition but still it is not picking the .cs files from the project folder. I have attached the console output logs for your reference.

[sonarlogs.txt](https://community.sonarsource.com/uploads/short-url/9JmNlOg43SmiTwrZuXcAYPmRE2r.txt) (2.9 KB)

---

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 6, 2023, 6:48pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/6 "2023-09-06T18:48:38Z")

</div>

Update here!!

I have added some a sonar-project.properties file and I was getting this attached logs.  
[sonarlogs\_latest.txt](https://community.sonarsource.com/uploads/short-url/m6FTUCjXYZAl5WDoI1JleciYIpV.txt) (2.6 KB)  
[sonar-project.properties.txt](https://community.sonarsource.com/uploads/short-url/sKFVYJSFuNbzDJ9M5f3z90w4BVo.txt) (381 Bytes)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 7, 2023, 5:32pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/7 "2023-09-07T17:32:41Z")

</div>

Hey there.

As mentioned in the logs:

> WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or [VB.NET](http://VB.NET), you must use the SonarScanner for .NET 5.x or higher, see [SonarScanner for .NET](https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html)

---

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 7, 2023, 5:56pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/8 "2023-09-07T17:56:41Z")

</div>

Hey Colin,

FYI, I was already configured sonar-scanner-msbuild-5.13.1.76110-net5.0 this version dll in Jenkins. But still it was throwing the same error and later it got fixed I think and in the same logs it was telling that no protobuf found contact the community team.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 7, 2023, 5:59pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/9 "2023-09-07T17:59:00Z")

</div>

Let me suggest attaching your **full** Jenkins logs (the 20 lines you shared won’t be enough to figure out what’s going on) including the execution of the Scanner for .NET and your .NET build.

---

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 7, 2023, 6:22pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/10 "2023-09-07T18:22:38Z")

</div>

Please find the attached.

[Jenkins-logs.txt](https://community.sonarsource.com/uploads/short-url/bKxUvovi3MTzjOkDGUgcXnEwOz9.txt) (15.8 KB)

 ![MSBuild_Jenkins_Configs](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/8/28f8427858f5ea45ca08b201a67e689a17abdfe4.jpeg)  
 ![SonarQube Scanner_Jenkins_Configs](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/3/a/3a70cd5d7dff109a69005b1fd32c6c052317852c.jpeg)  
 ![SonarScanner_Jenkins_Config](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/6/d/6dbfe8ddf153099a76aea62a41ba2b51438f42c6.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 8, 2023, 5:24am UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/11 "2023-09-08T05:24:50Z")

</div>

Hey there.

The logs you shared also show you executing the `sonar-scanner` and not the Scanner for .NET.

Have you reviewed the [Analyzing other project types](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/jenkins-extension-sonarqube/#other-project-types) section of the documentation for the Jenkins extension? It includes an example for using the SonarScanner for .NET.

---

<div class="post-metadata">

**Author:** ![Karthi\_Niranjan\_K\_S](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karthi_niranjan_k_s/32/48905_2.png) [@Karthi\_Niranjan\_K\_S](https://community.sonarsource.com/u/Karthi_Niranjan_K_S)\
**Post date:** [September 8, 2023, 6:00am UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/12 "2023-09-08T06:00:31Z")

</div>

Hello,

I have now tried removing the SonarQube scanner from the Jenkins configs. But still same logs. I have attached the logs and the pipeline script as well for you reference.  
[Jenkins\_logs.txt](https://community.sonarsource.com/uploads/short-url/dNCHct71L3reaEEQae3RBtW7BM9.txt) (15.8 KB)  
[pipeline {.txt](https://community.sonarsource.com/uploads/short-url/q0MH9814pNdSRUtWrivFTQXt898.txt) (1.5 KB)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 8, 2023, 6:05am UTC](https://community.sonarsource.com/t/sonarqube-is-not-picking-the-cs-file-and-not-analyzing-it/98664/13 "2023-09-08T06:05:26Z")

</div>

Again, I suggest following this example:

> [@Colin](#):
>
> Have you reviewed the [Analyzing other project types](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/jenkins-extension-sonarqube/#other-project-types) section of the documentation for the Jenkins extension? It includes an example for using the SonarScanner for .NET.
