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

Libraries that target netstandard2.0 not compatible with NUnit v4.0 #4568

Closed
CaptnCodr opened this issue Nov 28, 2023 · 6 comments
Closed

Libraries that target netstandard2.0 not compatible with NUnit v4.0 #4568

CaptnCodr opened this issue Nov 28, 2023 · 6 comments

Comments

@CaptnCodr
Copy link

CaptnCodr commented Nov 28, 2023

Hey, I'm maintainer of FsUnit and I'm currently trying to upgrade to NUnit v4.0.
I realized that NUnit now targets only .NET Framework 4.6.2 & .NET 6.0, the FsUnit nuget package which wraps NUnit targets among others netstandard2.0 for a broad compatibility.

Now, there is a huge problem for all users that have .NETStandard in their projects or people that ship libraries to their community.
So, NUnit v4.0 is currently not usable for a lot of users.

I saw that these changes were made here:
https://github.com/nunit/nunit/pull/4430/files#diff-213f730230234cb4b8fde7db80cdfd395d64c9f2e1c26385d00a6e185f1572bd

Why has this been done? Are there any compatibility issues with netstandard2.0? Will netstandard2.0 comes back in a fix?

PS: netstandard2.0 cover a lot of supported frameworks for now, see here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

Thank you

@OsirisTerje
Copy link
Member

OsirisTerje commented Nov 28, 2023

Thank you for getting in touch!

NUnit 4 can test any library that targets netstandard 2.0 and 2.1.

It is the test projects itself that needs to target anything above netframework 4.6.2 or .net 6.0.

So this should not be a blocker for any library.

I am sure you know, but for anyone else reading this: Note that NUnit (and any other testframework) must target something that can be executed, a platform. Netstandard is not intended for that, and must be run in the context of something that can, .net framework or .net core.

Why has this been done?
Are there any compatibility issues with netstandard2.0?

The reason for the change is that we need to reduce the number of supported frameworks. The code was getting too tangled up in #ifdefs, and we could not any longer take advantage of new features in dotnet going forward. We were also struggling with differences in how processes are handled. It became a blocker for going forward. So we needed to make a choice here.

Will netstandard2.0 comes back in a fix?

No, it is not possible. We are past that line now. If we try, it will probably break.

We're following, but lagging, the Microsoft support lifecycle. Note that we will still release upgrades for the NUnit 3.X series, which will continue to support the older frameworks. We will backport essential issues to that series. Issues that will be backported will be marked with the label require:backport . This will also be on demand.

About the decisions, see #4424 , #3070, #4419 and this comment: #4419 (comment) .

I don't think we have been aware of the FsUnit project. It would be nice to set up some channels for maintainers that could speed up communication and also make sure breaking changes are discussed with the maintainers before we act on them. We do have the slack account https://nunit.slack.com (Invite here: https://join.slack.com/t/nunit/shared_invite/zt-287bueokg-vivjHORhFp4AkyHPx7TQ9g) . We could also set up something else, open for suggestions.

@CaptnCodr
Copy link
Author

CaptnCodr commented Nov 29, 2023

Thank you for the quick response.

I understand and appreciate your work.

I assume - when I upgrade to NUnit v4 - that setting the target frameworks to net6.0 and net462 in FsUnit would have the same effect as it set to netstandard2.0? (looking to the Microsoft lifecycle)

I know phasing out netstandard2.0 you lose all the users from Mono, Xamarin, UWP and Unity.
Mono actually uses NUnit, when they see it's phasing out they could move to another testing framework.
All testing frameworks that I know are targeting minimum of one .NET Standard which covers a lot of other users than only .NET Framework or newer .NET.

It's a bit harsh cutting out netstandard2.0 from a wide used framework, isn't it?

I'll have a look and make a plan supporting NUnit 3.X and v4 and testing out the upgrades.

@OsirisTerje
Copy link
Member

I know phasing out netstandard2.0 you lose all the users from Mono, Xamarin, UWP and Unity.

Why would that be? They can still test netstandard. Do their implementation embed the NUnit framework? Do you have some links to these?

@OsirisTerje
Copy link
Member

It's a bit harsh cutting out netstandard2.0 from a wide used framework, isn't it?

Not so sure it is. Looking at this post https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/ the .net 5.0 and upwards are essentially .net Standard vNext.

@CaptnCodr
Copy link
Author

Not so sure it is. Looking at this post https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/ the .net 5.0 and upwards are essentially .net Standard vNext.

Thank you for clarification, @OsirisTerje.

Do their implementation embed the NUnit framework? Do you have some links to these?

I did not find any packages or projects those embed NUnit, but that would apply to all testing frameworks that are based on NUnit.

@CaptnCodr
Copy link
Author

FsUnit will upgrade to NUnit v4 and drop netstandard2.0 as TargetFramework. The reasons are on the hand.

Thank you for developing NUnit. I'll close this here.

@CaptnCodr CaptnCodr closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants