sonar-dotnet
sonar-dotnet copied to clipboard
Target netstandard2.0 instead of net46
Context
#2961 introduced netstandard2.0
targetting to ensure that we also run cross platform
#5976 removed netstandard2.0
targetting from CI run and let it only locally for CI performance reasons and unit testring
Description
We need to either:
- drop net46 support and target only netstandard2.0
- ~~add parallel CI step to build netstandard2.0~~
from https://dotnet.microsoft.com/en-us/platform/dotnet-standard#versions
This doc recommends 4.7.2 to be sure https://github.com/dotnet/standard/blob/v2.1.0/docs/versions.md
The versions listed here represent the rules that NuGet uses to determine whether a given .NET Standard library is applicable. While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.
Discussion from LTS planning: 4.6.2 is the lowest supported by Microsoft, so it would be easier to move to 4.6.2
We've decided to deprecate net46
support before 9.x LTS.
We will drop it in SQ 10.1 - 2nd release after LTS
FYI: I confirm that netstandard2.0
is the current recommendation for analyzers and code generators. This is what we use on roslyn analyzers.
This will indeed drop support for net46
but as stated by @andrei-epure-sonarsource, net462
is now the oldest supported version.
ToDo: Update SymbolicExecution/Roslyn/OperationProcessors/Invocation/ProcessLinqEnumerableAndQueryable to use nameof
for the other members
Deprecation of net46 analysis environment was announced here: https://community.sonarsource.com/t/dropping-support-for-build-environments-with-net-framework-4-62/76528
There's a PR ready, but it's blocked due to the Roslyn bug https://github.com/dotnet/roslyn/issues/67211 for now.
It should get fixed after VS 17.5 servicing release. VS 17.5.3 has MsBuild 17.5.1 and that is not enough.