NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

Rationale for dropping netstandard2.0 support?

Open pardahlman opened this issue 3 years ago • 3 comments

Looking forward to the next major version of NServiceBus. I was surprised to see that you are dropping support for netstandard2.0 - what is the rational for this? It looks like the change was introduced in this commit https://github.com/Particular/NServiceBus/commit/64548099037c225de570f42586f829e26c33d2ad. It was merged #5913 but introduced in (closed) PR #5890.

pardahlman avatar Jul 06 '22 12:07 pardahlman

NServiceBus 8 will be targeting net472 and net6.0. Is there any platform you were hoping to target with NServiceBus 8 that wouldn’t be supported by those targets?

DavidBoike avatar Jul 07 '22 01:07 DavidBoike

Well, yes - I do believe that we have one or two legacy systems running net462 and newer services still on net5.

We are moving to net6, but the way dependencies are bundled with the project type (e.g. System.Text.Json in Microsoft.NET.Sdk.Web) in combination with breaking changes in .NET 6 makes it a slower process than just changing target framework and deploy.

Another aspect is the impact of our private, downstream NuGet packages that bundles NServiceBus with application specific customization. These packages can no longer target netstandard2.0.

It feels like a big change in NServiceBus, and I'm surprised that there are no announcements or even clues in issues/PRs as to why this change is made.

pardahlman avatar Jul 08 '22 06:07 pardahlman

You're right, it is a big change. That's why it's a major version, because removing target frameworks is a breaking change. NServiceBus 8 is also still in beta, so a lot of the communication just hasn't happened yet.

But here are some important things to keep in mind:

  • .NET Standard is declining in relevance. See Microsoft's post on the future of .NET Standard which was written almost 2 years ago now, as well as Microsoft's documentation on problems with .NET Standard.
  • In accordance with our support policy we're developing NServiceBus 8 to be supported for the next 5-6 years. Targeting netstandard2.0 would allow the code to run on a bunch of platforms that are already out of support, and that we are not testing. I appreciate that the upgrade from net5.0 to net6.0 isn't a walk in the park (I was part of a group that verified our .NET 6 support) but officially .NET 5 is already out of support (as a non-LTS release) and .NET Core 3.1 will also end in December.
  • .NET Framework doesn't really support netstandard2.0 properly until 4.7.2. (Details are here though it's really in the weeds. The comment here says 4.7.1 would have full netstandard2.0 but that didn't end up happening until 4.7.2.) See the 2nd footnote under the netstandard2.0 support table here which says "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."
  • NServiceBus is wire compatible, so you don't have to upgrade everything in one go. You can run NServiceBus 7 and NServiceBus 8 endpoints together.

If you have private packages that bundle NServiceBus, then you will definitely need a new version of that to support NServiceBus 8, regardless of target framework. A package like that could target either net472 for only .NET Framework, net6.0 for only .NET, or net472;net6.0 just like NServiceBus does if you still have stuff both on .NET and .NET Framework.

DavidBoike avatar Jul 08 '22 15:07 DavidBoike