I know this question has /several/ answers to it, but I have yet another unique answer that I haven't seen as a way to resolve it. I'm hoping this helps someone else out there.
To use the Unit Test Sessions, one external dependency is the Microsoft.Net.Test.Sdk, at some point in the VS pipeline the xunit.runner.visualstudio stopped working correctly for the ReSharper Unit Test Session flavor of test runner. The following is how I ended up with this problem, and how I solved it.
My issue and answer arose from seeing the Inconclusive when converting some of my net451 libraries into netStandard 2.0 in order to allow my team to develop in Core or Framework. When I went into the newly finished netStandard2.0 libraries and started converting their old unit test projects into the new solutions, I ran into issues. You can't run Unit Tests in a net Standard project, so I chose to downshift to net472 for my unit testing projects.
At this point I'll note, .csproj files have gone through a change since .net Framework. In order to cleanly integrate with build packs for nupkg files and .net Standard libraries, you need to change your references to be handled with PackageReference instead of packages.config.
I had a few libraries coupled to Windows that couldn't be converted to netStandard, so when updating their dependencies to use the new netStandard libs, I realized that the dotnet pack command would fail if their .csproj files were in the old format. To fix that, not only did they need to be converted to PackageReference from packages.config, I had to manually update the .csproj files to the newer VS2017 format. This allowed those libraries to build into nuget packages cleanly as net472 libraries referencing netStandard2.0 dependencies.
There is a tool to convert the package organization behavior for you, it keeps the old .csproj style and uses the PackageReference in the .csproj. And due to the above I got in the habit of migrating the .csproj style to the VS2017 format manually.
So in summary, I was receiving the Inconclusive when I was using both PackageReference for my dependencies AND my Unit Testing Project .csproj file was in the VS2017 style.
I was able to solve this by deleting my project, recreating it exactly as it was in net472 and instead of converting it to the VS2017 .csproj format, I left it in the old format.
The old format, for whatever reason, allows my Test Session to complete.
I'm curious of few things:
- If a lot of the people with this issue were experiencing it in netCore versions where the .csproj files come in the new format by default.
- If people able to solve the issue by other means than my reproduceable problem/fix were on the netCore versions of .csproj and using netCore as their test project as well.
- If this solution will help any of the people that weren't able to fix it through rebuilds or deletion of vs/bin folders or additional entries in their .csproj files.
I don't know that this answer is the one true solution that ReSharper would need to fix it for everyone, but it is reproduceable for me, and solves my problem to leave the unit test project as the old version of .csproj file, at least when I have a net472 unit test project referencing netStandard2.0 libraries.
It should also be noted that VS2017 .csproj files deprecates the need for an AssemblyInfo.cs file in the Properties folder, which I'm not sure if that causes issues for the Unit Test Sessions as well.