Can we use SonarScanner.MSBuild.exe in .yml file?

We are using sonarqube for asp.net 4.5 framework project. And we are trying to use bitbucket cloud integration. But when we try to add project using bitbucket CI/CD pipeline. We are getting setting only for asp.net core for instance dotnet sonarscanner but what about old project. Can you please guide us?

Hey there.

It must be possible since the introduction of Windows runners, but we have no tutorial for it right now.

You should be able to simply download the SonarScanner for .NET executable as a part of your pipeline, and execute it along with your build.

Hi,
I tried with following yml file and getting issue ```
SonarScanner.MSBuild.exe: command not found

image: mcr.microsoft.com/dotnet/core/sdk:latest

definitions:
  steps:
    - step: &build-step
        name: SonarQube analysis
        caches:
          - sonar
        script:
          - apt-get update
          - apt-get install --yes openjdk-11-jre
          - dotnet tool install --global dotnet-sonarscanner
          - export PATH="$PATH:/root/.dotnet/tools"
          - cd AutoBLOX
          - SonarScanner.MSBuild.exe begin /k:"XXXXXXX" /d:"sonar.host.url=XXXXXXX0" /d:"sonar.login=${SONAR_TOKEN}"
          - MSBuild.exe /t:Rebuild
          - SonarScanner.MSBuild.exe end /d:"sonar.login=${SONAR_TOKEN}"
  caches:
    sonar: ~/.sonar

pipelines:
  branches:
    '{master}': # or the name of your main branch
      - step: *build-step

@Colin Can you please help me?

Hey, I am also finding difficulty with this can we do it this way…?