nunit / nunit3-vs-adapter

NUnit 3.0 Visual Studio test adapter for use under VS 2012 or later
https://nunit.org
MIT License
202 stars 104 forks source link

Test discovery NUnit4 fails with framework net7.0-windows #1141

Closed rgroenewoudt closed 7 months ago

rgroenewoudt commented 7 months ago

There are no tests found if the targetframework is net7.0-windows. However, it works fine without the platform suffix: net7.0.

This is a problem as my other projects target windows and thus the unit test project also needs to use it.

This only happens with the new NUnit 4. In the previous 3.14 version it isn't a problem.

Same issue with net8.0-windows. Result is the same in Visual Studio and dotnet test -t.

Latest versions of everything:

Example project: TestProject3.zip

OsirisTerje commented 7 months ago

The fix is described here: https://github.com/nunit/nunit/issues/4564 There is a dev version available on Myget, see https://www.myget.org/feed/nunit/package/nuget/NUnit/4.1.0-adev.1 Or use the workaround described here: https://github.com/nunit/nunit/issues/4564#issuecomment-1829047785

OsirisTerje commented 7 months ago

Same issue with net8.0. Result is the same in Visual Studio and dotnet test -t.

Sorry, didn't see this. Can you explain what you mean? Using net 8 works fine here.

rgroenewoudt commented 7 months ago

@OsirisTerje I meant using net8.0-windows. But I can confirm the workaround works :).

Perhaps keep the issue open until the next NUnit version is released officially, in order to prevent duplicate issues.

OsirisTerje commented 7 months ago

Awesome!

I think we need to add some announcement or "Tricks and Traps" section somewhere visible. I'll let this stay open for a short time, but we need to close them down. If people search I think they will find it anyway.

OsirisTerje commented 7 months ago

@rgroenewoudt Check the latest adev.2 on the myget feed

rgroenewoudt commented 7 months ago

I can confirm the latest 4.0.1 works :)