# Analysis is not being publish in Sonar

**URL:** <https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121>\
**Category:** SonarQube Server / Community Build\
**Tags:** failed-analysis, sonarqube, dotnet, coverage\
**Created:** [March 27, 2024, 3:28am UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121 "2024-03-27T03:28:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabricioasv](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabricioasv/32/4427_2.png) [@fabricioasv](https://community.sonarsource.com/u/fabricioasv)\
**Post date:** [March 27, 2024, 3:28am UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/1 "2024-03-27T03:28:04Z")

</div>

Hi,

I’m trying to build an old .net framework 4.5.2 application using .yml file configuration in AzureDevops and I already fix some issues, but now my pipiline finish with success but they don’t publish sonar analysis to server.  
One thing that I noticed, is that the SonarQubeAnalyze@5 task stop in this lines:

```auto
00:17:27.72 Writing processing summary to C:\Projects\PROJECT\_agents\_work\1\.sonarqube\out\ProjectInfo.log
Calling the TFS Processor executable...
Executing file C:\Projects\PROJECT\_agents\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.19.1\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.TFSProcessor.exe
  Args: ConvertCoverage C:\Projects\NetView\_agents\_work\1\.sonarqube\conf\SonarQubeAnalysisConfig.xml C:\Projects\NetView\_agents\_work\1\.sonarqube\out\sonar-project.properties 
  Working directory: C:\Projects\PROJECT\_agents\_work\1
  Timeout (ms):-1
  Process id: 17160
Attempting to locate the CodeCoverage.exe tool...
Attempting to locate the CodeCoverage.exe tool using setup configuration...
Attempting to locate the CodeCoverage.exe tool using registry...
WARNING: Failed to find the code coverage command line tool. Possible cause: Visual Studio is not installed, or the installed version does not support code coverage.
Process returned exit code 0
The TFS Processor has finished
Calling the SonarScanner CLI...
Executing file C:\Projects\PROJECT\_agents\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.19.1\classic-sonar-scanner-msbuild\sonar-scanner-4.8.1.3023\bin\sonar-scanner.bat
  Args: -Dsonar.scanAllFiles=true -Dproject.settings=C:\Projects\PROJECT\_agents\_work\1\.sonarqube\out\sonar-project.properties --from=ScannerMSBuild/5.15 --debug <sensitive data removed>
  Working directory: C:\Projects\PROJECT\_agents\_work\1
  Timeout (ms):-1
  Process id: 17012
Process returned exit code 0
The SonarScanner CLI has finished
00:17:28.018 Post-processing succeeded.

```

And I saw in other .net core case that after this steps, this task execute a lot of commands and print SUCCESS at the end.  
I try to search any information in sonar and azure devops files, but without success.

This is my .yml file today:

```auto
pool: SelfHostedAgent-Windows

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
# Prepare Analysis Configuration task
- checkout: self
  fetchDepth: 1
  clean: true

- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: SonarQubePrepare@5
  displayName: 'Prepare analysis on SonarQube'
  inputs:
    SonarQube: 'SonarQube'
    scannerMode: 'MSBuild'
    projectKey: 'PROJECT_KEY'
    extraProperties: |
      sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml
      sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml
      sonar.cs.xunit.reportsPaths=$(Agent.TempDirectory)/testresults.trx
      sonar.scm.disabled=true
      sonar.verbose=true

# DotNet build
- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

# SQ Run Code Analysis task - QC3
- task: SonarQubeAnalyze@5
  displayName: RUN SonarQube
  inputs:
    jdkversion: 'JAVA_HOME_17_X64'

# Complete the analysis and upload the results to the server
- task: SonarQubePublish@5
  displayName: 'Publish analysis results to SonarQube'

```

Cloud you help me?  
I’m kind of lost right now, 🙂

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 28, 2024, 4:35pm UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/2 "2024-03-28T16:35:32Z")

</div>

Hi,

Could you share your full, verbose log?

#### Share the Scanner for .NET verbose logs

- Add `/d:"sonar.verbose=true"` to the…
  - `SonarScanner.MSBuild.exe` or `dotnet sonarscanner` **begin** command to get more detailed logs
    - For example: `SonarScanner.MSBuild.exe begin /k:"MyProject" /d:"sonar.verbose=true"`

  - “SonarQubePrepare” or “SonarCloudPrepare” task’s `extraProperties` argument if you are using Azure DevOps
    - For example:

```yml
- task: SonarCloudPrepare@1
    inputs:
      SonarCloud: 'sonarcloud'
      organization: 'foo'
      scannerMode: 'MSBuild'
      projectKey: 'foo_sonar-scanning-someconsoleapp'
      projectName: 'sonar-scanning-someconsoleapp'
      extraProperties: |
        sonar.verbose=true

```

- The important logs are in the `END` step (i.e. SonarQubeAnalyze / SonarCloudAnalyze / “Run Code Analysis”)

#### Share the msbuild detailed logs

```auto
MsBuild.exe /t:Rebuild /v:d

```

or

```auto
dotnet build -v:d

```

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![fabricioasv](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabricioasv/32/4427_2.png) [@fabricioasv](https://community.sonarsource.com/u/fabricioasv)\
**Post date:** [March 29, 2024, 2:47am UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/3 "2024-03-29T02:47:54Z")

</div>

Sure @ganncamp

[SonarQubeAnalyze\_log.txt](https://community.sonarsource.com/uploads/short-url/202DIXSVzONYs2eaJQy6yrpiZYn.txt) (202.3 KB)

Tks,  
Fabrício

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 29, 2024, 11:47am UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/4 "2024-03-29T11:47:24Z")

</div>

Hi Fabricio,

Thanks for the log file. Unfortunately, it didn’t tell me much more than the snippet you provided in your initial report. I’m going to flag this for more expert eyes.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![fabricioasv](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabricioasv/32/4427_2.png) [@fabricioasv](https://community.sonarsource.com/u/fabricioasv)\
**Post date:** [March 29, 2024, 1:08pm UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/6 "2024-03-29T13:08:14Z")

</div>

Ok @ganncamp ! Thank you.  
Just let me know if you need any other information.

Fabricio

---

<div class="post-metadata">

**Author:** ![fabricioasv](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabricioasv/32/4427_2.png) [@fabricioasv](https://community.sonarsource.com/u/fabricioasv)\
**Post date:** [March 29, 2024, 2:18pm UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/7 "2024-03-29T14:18:19Z")

</div>

@ganncamp I remembered something …  
Some days ago I replyed another topic about the same problem, but in that time I was executing sonar in my local environment. Here is the topic [Sonarqube for .NET - Post Processing succeeded but there is no report in Dashboard](https://community.sonarsource.com/t/sonarqube-for-net-post-processing-succeeded-but-there-is-no-report-in-dashboard/108230/19).

I found solution for thar problem forcing sonar-scanner.bat execution after sonar offical commands.

It seems that we have same problem here.  
But in AzureDevops I don’t know how to do that. if this could be a solution, can you help me with SonarQubeAnalyze@5 task?

Tks,  
Fabrício

---

<div class="post-metadata">

**Author:** ![fabricioasv](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabricioasv/32/4427_2.png) [@fabricioasv](https://community.sonarsource.com/u/fabricioasv)\
**Post date:** [March 29, 2024, 4:02pm UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/8 "2024-03-29T16:02:00Z")

</div>

Add more information @ganncamp 🙂

I found this thread [SonarScanner for .net doesn’t sending result to server.](https://github.com/SonarSource/sonar-scanner-msbuild/issues/1706) that seams the same problem I’m facing now.

Maybe can help you with some analysis.

Fabrício

---

<div class="post-metadata">

**Author:** ![fabricioasv](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabricioasv/32/4427_2.png) [@fabricioasv](https://community.sonarsource.com/u/fabricioasv)\
**Post date:** [April 1, 2024, 10:24am UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/9 "2024-04-01T10:24:11Z")

</div>

Hi @ganncamp , more info for you.

I checked that the problem is really about calling sonar-scanner from SonarQubeAnalyze@5 task in AD.  
I saw this because I created .ps1 file with the follow command to execute directly in my .yml file and the analysis start to show in Sonar web:

`sonar-scanner "-Dsonar.token=TOKEN" "-Dsonar.projectKey=PROJECT_KEY" "-Dsonar.sources=." "-Dsonar.host.url=URL" "-Dsonar.scm.disabled=true"`

But now I have another problem. For some reason, even I using .net analyser, I’m receiving the follow message and code like the next example isn’t recognized as a problem:

_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)_

```auto
cliente = null;
cliente.Bairro = "Test";

```

I’m using sonar-scanner-6.1.0.83647-net-framework as sonar-scanner.

I know that you’re looking solution for the last problem, but can you help me with this too?

Fabrício

[sonar-scanner\_logs.txt](https://community.sonarsource.com/uploads/short-url/9BFDMkPVF6xEdYSVYOm640mVEkq.txt) (43.7 KB)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [April 1, 2024, 1:02pm UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/10 "2024-04-01T13:02:53Z")

</div>

Hi Fabricio,

We try to keep it to one topic per thread. Otherwise it can get messy, fast. Normally I’d tell you to create a new thread for this, but there’s really nowhere to go with it; this is the result you get when you use the SonarScanner CLI for .NET code. There’s a reason we went to the trouble of creating and maintaining a whole separate SonarScanner for .NET. 🙂

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![sebastien.marichal](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sebastien.marichal/32/69045_2.png) [@sebastien.marichal](https://community.sonarsource.com/u/sebastien.marichal)\
**Post date:** [April 2, 2024, 12:48pm UTC](https://community.sonarsource.com/t/analysis-is-not-being-publish-in-sonar/112121/12 "2024-04-02T12:48:03Z")

</div>

Hello @fabricioasv,

I see you are using a self-hosted agent for your pipeline.  
Could you tell me what .NET dependencies are installed on this host (MSBuild version, installed runtimes…)?

Could also provide the log for the begin step (the `SonarQubePrepare@5` task) as well as the build log?  
Please don’t forget to add the `/v:d` to your MSBuild parameter if not already there.

Thank you,
