Issue with Analyzing .NET Framework Projects using SonarScanner on Windows 11

Dears,
I am experiencing an issue when attempting to analyze a .NET Framework project using SonarScanner.MSBuild.exe on my local machine. Below are the details of my environment and the issue:

  • Operating System: Windows 11 Pro, 64-bit
  • SonarQube Version: Community Edition 10.6.0.92116
  • SonarScanner Version:
    • For .NET Core: sonar-scanner-8.0.0.97025-net
    • For .NET Framework: sonar-scanner-8.0.0.97025-net-framework

Issue Details:

  • When running SonarScanner.MSBuild.exe command on a .NET Framework project, I encounter a popup that states: “Cannot run this application on this operating system.”
  • In addition, the command prompt displays an “Access Denied” error.
  • Despite these issues with the .NET Framework project, I am able to analyze .NET Core projects successfully.

I would appreciate any guidance or support you can provide to help resolve my issue with .net framework applications.

Thank you for your assistance.

Hi,

Welcome to the community and thanks for this report!

To be clear, you’re using two different flavors of the scanner, and one works and the other gives you an error. Right?

 
Thx,
Ann

Thank you Ann for your reply,
Yes, I faced an error when trying to analyze .NET Framework projects, so I downloaded the framework scanner. Could you guide me on what exactly I should download to test .NET Framework applications?

Hi,

It seems reasonable that you would analyze .NET Framework projects with the framework-specific scanner. I was just trying to make sure I understood the situation. Now that I do, I’m quite sure I’m in over my head :sweat_smile: so I’m going to flag this for more expert eyes.

 
Ann

Hello @Wafaa_El_Sayed,

Sorry for the delay in the response.

Did you try to analyze your .NET Framework project using one of the other flavors (.NET Global Tool or the .NET version) of the SonarScanner for .NET?
It is not required to use the .NET Framework version of the scanner to analyze a .NET Framework project. For more information, see the documentation.

If you are still experiencing this issue with the other flavors, can you provide the scanner log in verbose mode?

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
        

Based on my understanding the issue is only happening during the begin step.

Are your .NET Core projects and .NET Framework part of the same solution?
If so, you can do a full analysis of your solution at once.

1 Like