xunit / visualstudio.xunit

VSTest runner for xUnit.net (for Visual Studio Test Explorer and dotnet test)
https://xunit.net/
Other
146 stars 81 forks source link

Currently Requires .Net Core 3.1 - which is out of support #360

Closed stevedcc closed 1 year ago

stevedcc commented 1 year ago

Since .Net Core 3.1 is out of support, I would like to remove it from my machine. This is not possible as the test runner does not run with .Net Core 5, 6 or 7.

jovinson-ms commented 1 year ago

Just ran into this - cleaned up old .NET versions and my tests suddenly stopped working!

stevedcc commented 1 year ago

I don't want to criticise an Open Source project: I'm sure they have their hands full. But when a large money-making corporation makes use of an opens source project in a commercial product product, I wish they would actually pay attention to this kind of thing.

As good as 4 months. Nothing.

bradwilson commented 1 year ago

@stevedcc Are you suggesting Microsoft should pay me to work on this? Because I'd be okay with that. 😂

bradwilson commented 1 year ago

2.5.0 will move this up to .NET 6 as minimum required version.

https://github.com/xunit/visualstudio.xunit/blob/86c0e57f3d8458b8b0f5e436f732dd9546d563dd/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj#L8

daiplusplus commented 1 year ago

@bradwilson I got stung by this breaking change today (all of my projects need to target .NET Core 3.1 because of upstream dependencies) - when I updated my NuGet package-reference to xunit.runner.visualstudio 2.5.0 in my .NET Core 3.1 project VS 2019 didn't complain at all, and forcibly installed it without any errors or warnings in the Error List window - the only indication something was wrong is in the Solution Explorer:

Package 'xunit.runner.visualstudio 2.5.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

I've since downgraded and added a max-version constraint so this won't happen in future when I do another routine nuget update, but isn't there a way to configure NuGet to block installs on known unsupported platforms?

Are you suggesting Microsoft should pay me to work on this? Because I'd be okay with that. 😂

I think if you reached out to someone on the VS test-tooling team and offered yourself up as an acqui-hire they'd be very interested (disclaimer: I used to be down the hallway from that team).

bradwilson commented 1 year ago

isn't there a way to configure NuGet to block installs on known unsupported platforms?

The behavior you're experiencing was added explicitly to NuGet to support backward compatibility, many years ago when .NET Core was new.

There was a decision made that when a package said "I support .NET Framework" then NuGet would allow you to just "try it and hope for the best" while giving you the restoration warning, because there was so much code that existed that was written for .NET Framework that might just work as-is for .NET Core, and it may take those library authors a long time to update them (if ever!) to indicate so.

That said... the implementation leaves something to be desired. This clearly has explicit low boundary for .NET Core (that being net6.0). NuGet shouldn't use this old and most unnecessary logic in this situation.

VS 2019 didn't complain at all

For what it's worth, we don't support VS 2019 any more as of 2.5.0. You'd probably need to stick to 2.4.x anyway, even if you upgraded to .NET 6.

I think if you reached out to someone on the VS test-tooling team and offered yourself up as an acqui-hire they'd be very interested

I actually had a verbal offer from them in 2017, but opted to go to Visual Studio App Center instead (which then landed me at GitHub). 😄