Open kurabirko opened 4 hours ago
Thanks for the solution. I'm normally using Rider though and installed Visual Studio just to verify this issue. I wouldn't have checked my visual studio setup were it not for you. Maybe adding this to the wiki might be nice?
It is in both the documentation tutorial and the GitHub readme. There is a section for Rider too...
I guess I wasn't really clear, apologies. I'm using Rider and "Build Tools for Visual Studio" to get some compilers etc. I did not have VS2022 before switching to TUnit. When I decided to go with TUnit I checked the documentation's rider section and switched the "Enable Testing Platform support" option. Test discovery was not working though. Then I installed VS2022, enabled the "Use testing platform server mode" option per your recommendation and everything started working. I this this particular behavior is not documented in the wiki, not the option in the rider settings. I don't know why the visual studio installation affected my rider setup though.
The VS option isn't needed for Rider. It probably started working because you restarted your IDE, or re-built the project after switching it on. The project needs to be built first (after enabling the testing platform setting) for test discovery to kick in.
Test discovery fails on both Rider and Visual Studio using the latest TUnit and .Net 9. I verified that MSTest works using
Microsoft.Testing.Platform
so I think this problem is related to TUnit. The built executable runs just fine, the problem is with the test explorers.I have the follwowing project configuration with a single test method.
Output pane in visual studio gives me the following exception.