SonarQube compatibility for .NET framework version 4.5

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): Sonarqube 10.3
  • how is SonarQube deployed: zip (on Amazon Linux 2023)
  • what are you trying to achieve: Scanning .NET framework 4.5 using .sln file
  • what have you tried so far to achieve this: Installed dotnet tool + scanner, tried to run the scan.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)! (only having screenshot at the moment)

Hi,

Sorry, but I can’t read that screenshot.

Can you try again to capture the text of the error? Better yet, can you provide full verbose logs?

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:
        - 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

MsBuild.exe /t:Rebuild /v:d

or

dotnet build -v:d

 
Thx,
Ann

I am running it on linux using dotnet tool, here is the log message below

usr/share/dotnet/sdk/7.0.407/Microsoft.Common.CurrentVersion.targets(1241,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at .NET SDKs downloads for Visual Studio [/root/projects/test_app/test.csproj]

Hi,

The docs should help.

 
Ann