.NET 6 and C#10 support update

Hi .NET Folks

Here’s an update on our .NET 6 and C# 10 support:

  • .NET Analysis can now parse the new C# 10 language features without failure. This is the first step for C# 10 support, next we will ensure that all our rules consider the new language features in their analysis.
  • We now support the lovely new C# 10 feature File Scoped Namespaces in the Types should be defined in named namespaces rule.
  • There are a number of new bug fixes and removals of False Positives, see the release notes for details.
  • We are currently working on updating the scanner so that it will run in an environment with just the .NET 6 SDK available. Watch this space for a release soon.

These changes are now available on SonarCloud and will be in the forthcoming SonarQube 9.2 release. Let me know if you have any questions, or comments.

Happy .NET coding.

Tom

12 Likes

A post was split to a new topic: Error when analyzing .NET 6 project on SonarCloud

Hello there. Thanks for the great news. Will be the Azure DevOps SonarCloud extension upgraded too (as a new version for the step, please mind the support for .net 5 as well)? E.g. should we upgrade the version for the step? See also (already closed) .NET 6 and C#10 support update

1 Like

Hi Jan

We will upgrade the Azure DevOps extensions with the new version of the scanner that has support for .NET 6. This will be backward compatible and won’t require a new major version of the extension, so your pipelines won’t need to change and the update should happen automatically (unless your extension has been manually installed on an agent).

Tom

1 Like

Hi, Will be the Bitbucket SonarCloud extension upgraded too?

1 Like

Hi, will .NET 6 support only need a new version of the SonarQube-Scanner or is there also a new update for the SonarQube server necessary?

1 Like

Hi Emre, welcome to the community :slight_smile:

I don’t believe the Bitbucket SonarCloud extension requires updating. You pipelines should install the SonarScanner for .NET directly (probably the CLI version) and should automatically pull the latest scanner version once it’s released. Let me know if you have any problems.

Tom

Hi, thanks Tom, it’s ok to not requires updating, actually i wanna ask you, will Bitbucket SonarCloud works well with .net 6 in same time with your updates, and how i get notification about that.

Hi Michael, welcome to the community :slight_smile:

The update to the scanner will allow it to run on a build agent with only .NET 6 available. One of the jobs of the scanner is to download the analyser from SonarQube (or SonarCloud). The analyser is the component that finds issues in your code and this also needs updating to work with the new features in C#10. The latest version of our analyser, that is capable of parsing C# 10 and recognising the new scoped namespace feature, requires the recently released SonarQube 9.2 and future versions of SonarQube will continue to improve the analysis of C#10 features. SonarQube versions prior to 9.2 may raise errors during analysis depending on the features you are using. It is not possible to update the analyser without updating the version of SonarQube. On Sonarcloud the analyser is updated as soon as it is available.

The general guideline if you are using SonarQube is to keep updating to the latest version if you want the best support for new language features.

I hope that answers your question and helps clear up any confusion between what the scanner and analyser do.

Tom

Yes! SonarCloud is the best way to get the latest and greatest analysis if you are using new languge versions :slight_smile: The analyser will be updated automatically and you won’t need to do anything, and if your bitbucket pipelines are downloading the latest scanner then that will automatically update too.

If you want to know what’s being released I will post announcements here and for significant updates we will post a link from the ‘Whats New on SonarCloud’ section available on the top menu bar in SonarCloud.

Tom

1 Like

2 posts were split to a new topic: .NET 6 project scan does not work

Hello Again

On Friday we released a new version of the SonarScanner for .NET that supports running on environments with only the .NET 6 SDK available. This should help those folks using GitHub Actions or the .NET SDK Docker container as a build environment. Rather than create a new version, we have made the .NET 5 version a .NET 5+ version that is forward compatible. You can download the new version from the SonarQube and SonarCloud documentation. We are currently working on updating the Azure Devops Extension, I’ll update here once that’s released.

Tom

5 Likes

Are there plans to make this analyzer available for the current LTS version of SonarQube (8.9)? My company follows LTS release cycle for upgrades, and this is an impediment to continued SonarQube use by projects using dotnet.

3 Likes

Hi Mike

Welcome to the community :slight_smile:

Our policy with LTS versions is only to fix bugs and apply security patches to ensure that we maintain complete stability for those who need it. Updating the analyser would add new functionality so I’m afraid we are unable to do this. To have support for the latest language versions we recommend you upgrade to the latest SonarQube version (for which we can also provide commercial support if you need it).

I hope that provides some clarity, even if it doesn’t provide you with a solution!

Tom

seems it is not so much backward compatible in the end :frowning:

I would really, really prefer deploying chnages in a more controlled (and safe) matter, e.g. enforcing the new version of the extension with the version number, see SonarCloud Azure DevOps extension 1.25 broken - #7 by jvilimek

1 Like

Hi @jvilimek

Please note that the change refering to .NET5/6 is not the one that introduced the regression. Sorry about that.

Mickaël

1 Like

Thanks. Btw. any place (github/blog/…) where we can check the current progress of .net C#10 support? e.g. following

Some kind of feature mattrix with indication whenever its supported or not would be awesome (both in sonarscanner and devops extension/other tools if it may be different).

1 Like

Hi Jan

There isn’t anything public at the moment but I understand the need. I’m reviewing the documentation at the moment and I’ll see what I can do.

Thanks

Tom

1 Like

Any updates on the ADO Extension? :slightly_smiling_face:

A post was split to a new topic: Is license kept when upgrading from 8.9 LTS to 9.2