-
Notifications
You must be signed in to change notification settings - Fork 143
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
Ensure Scanner runs with .NET 6 SDK #1095
Comments
Maybe you just want to create a build for .NET 6 and investigate afterward... This blocks our adoption of .NET 6 :) |
Hi @msallin Sorry hear that. To help me understand the 'why', can you let me know where your build agent is running? Why would it not be possible or desirable to also have .NET 5 installed? Thanks Tom |
We run our builds on Jenkins. For this, we do xcopy "install" of the SDK. And our pipeline is built to be able to just have one SDK. To have multiple, we have to do an xcopy/merge "install" which is pain. Hence, we always just use the latest SDK. |
Agreed, the sooner we can get a .NET 6 build, the better |
This is the error I get attempting to run a scan on a .NET 6 projects on a GitHub Actions runner (ubuntu-20.04):
That's a bit confusing to me, because according to GitHub that runner already has (multiple!) .NET 5 SDKs installed: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#net-core-sdk |
Hi @IGx89 Thanks for reporting this. Although the Github Action Runner has multiple SDKs installed, when we include:
It disables the other .NET versions We will get a .NET 6 compatible scanner out as soon as we can, in the meantime there is a workaround you can use by switching between .NET 5 & 6 at the appropriate points. I've created an example of this here |
An alternative workaround to try would be to execute the scanner as follows:
See the MS docs for more information. |
That's a great idea, thanks! Adding the following to the SonarScanner Begin/End steps caused it to work:
Unfortunately however, it's no longer reporting LOC/issues for a lot of the *.cs files (Blazor webapp). Still better than turning off scanning completely at least. |
Hello @IGx89. Would it be possible to provide a reproducer for this problem? |
You actually sort of already provided one yourself -- just take https://github.com/andrei-epure-sonarsource/aspnet5mvc-reproducer and change the csproj TFM from |
Currently sonarscanner doesn't work if only .net 6.0 is installed. As suggested in [this](SonarSource/sonar-scanner-msbuild#1095 (comment)) thread, using RollForward flag should fix that issue
Does latest version of Sonar Scanner supports .NET6 API projects , In docs it says it supports the .NET6 Web Projects only. if not can i know which version of Sonarscanner supports .NET6 API Projects |
@balajigv-mcd we explicitly mention .NET Web Projects because they have a new compilation mechanism for Razor files. Yes .NET 6 API Projects are supported as well. (cc @tom-howlett-sonarsource ) |
Hi. I'm facing same problem with .NET 6 + GitLab CI. + SonarCloud I'm a bit confused because everyone talk about install SDK or use some version of .net. But when I setted up my account and import the project from my GitLab account the suggested job just call the binary Where should I specify the framework version? or where to passing parameters to any dotnet build or dotnet test? This is my Job which was proposed by SonarCloud wizard: sonarcloud-sast-qa: image: name: sonarsource/sonar-scanner-cli:latest entrypoint: [""] stage: test variables: SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task cache: key: "${CI_JOB_NAME}" paths: - .sonar/cache script: - sonar-scanner |
Hi @dacardona, this repository is not related to |
The Scanner currently requires an SDK that matches the major and minor version of the scanner build. We would like to allow users to run the scanner on agents with only .NET 6 SDK to match our policy of allowing the scanner to run where the code is built without additional installs.
The goal of this ticket is to:
The text was updated successfully, but these errors were encountered: