Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SonarQube plugin with .NET 5.0+ and build results #98

Open
Traddles opened this issue May 19, 2022 · 2 comments
Open

SonarQube plugin with .NET 5.0+ and build results #98

Traddles opened this issue May 19, 2022 · 2 comments

Comments

@Traddles
Copy link

Traddles commented May 19, 2022

The SonarQube scanner doesn't support .NET 5.0+ according to warning message from execution log:
WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html

When using SonarScanner for MSBuild tool the analysis works fine. However, the results of the analysis are not added as a tab in the Build results page.

Is there a way to solve this? And is there a version for the SonarQube scanner tool planned that will support .NET 5.0+ because frankly that seems to be the simplest use case.

Versions used:
SonarScanner for MSBuild=5.5.3.43281-net46
SonarQube Scanner=4.7.0.2747
TeamCity Enterprise=2020.2.3 (build 86002)
SonarQube Server=9.4 (build 54424) Community Edition

@tolache
Copy link

tolache commented Aug 2, 2022

Hi, it looks like you are using the version of SonarScanner for MSBuild incompatible with .NET 5.0+. You will need to download the compatible version of the tool from SonarQube's website and add it to TeamCity.

  1. Go to https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/ and download SonarScanner for .NET 5+.
  2. Extract the sonar-scanner-cli-XXXX.jar file from the downloaded file. It is located under sonar-scanner-msbuild-YYYY-net5.0.zip/sonar-scanner-XXXX/lib.
  3. Go to TeamCity > Administration > Tools > SonarQube Scanner > Install versions ... > upload the extracted sonar-scanner-cli-XXXX.jar file.
  4. If necessary, make the uploaded tool version default.

@tallior
Copy link

tallior commented Nov 29, 2022

@tolache i tried to follow these steps, but it doesn't work:

Should be single zip, name should contain version, eg: sonar-scanner-msbuild.4.0.2.892.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants