Blake Rivell
Blake Rivell

Reputation: 13875

XUnit2 not finding tests anymore after upgrading VS2015 to Update 3

When doing a clean / rebuild on my solution so the tests appear in the Test Explorer I get the following error: 'An Unexpected error detected. Check the Tests Output Pane for details.'

And none of the tests appear anymore.

When I check the tests output pane it says: 'test-xunit' returned '-532462766' (Unless the Output Window with Tests selected in the DropDownList is not the Output Pane. Please let me know if it isn't.)

I believe this started happening ever since I updated VS2015 to the latest and greatest (Update 3). Any ideas on what is going on because my code hasn't changed since the last time it worked.

Exact error:

------ Discover test started ------
Discovering tests in 'C:\Projects\MyProj\test\WebAPI.Tests\project.json' ["C:\Program Files\dotnet\dotnet.exe" test "C:\Projects\MyProj\test\WebAPI.Tests\project.json" --output "C:\Projects\MyProj\test\WebAPI.Tests\bin\Debug\net461\win7-x64" --port 33073 --parentProcessId 6868 --no-build]
'test-xunit' returned '-532462766'.
========== Discover test finished: 0 found (0:00:01.5093366) ==========

Upvotes: 3

Views: 872

Answers (2)

Michael Fredrickson
Michael Fredrickson

Reputation: 37378

Even after updating to preview builds and performing a clean rebuild, I continued to get the above error on test discovery.

For me, the issue was resolved by adding a preview version of Microsoft.DotNet.InternalAbstractions in addition to the preview versions of xunit as suggested in this other thread:

"dependencies": {
    "xunit": "2.2.0-beta4-build3444",
    "dotnet-test-xunit": "2.2.0-preview2-build1029",
    "Microsoft.DotNet.InternalAbstractions": "1.0.500-preview2-1-003177"
},

Upvotes: 2

Blake Rivell
Blake Rivell

Reputation: 13875

Yes, it is confirmed that the following versions break if your VS2015 Enterprise is updated to the absolute latest and greatest as if 7/19/2016.

Here are the changes I made that solved the problem:
FROM - Not working with Update 3

"dependencies": {
    "xunit": "2.1.0",
    "dotnet-test-xunit": "1.0.0-rc2-build10025"
},

TO - Working with Update 3

"dependencies": {
    "xunit": "2.2.0-beta2-build3300",
    "dotnet-test-xunit": "2.2.0-preview2-build1029"
},

If anyone has further information on this please share!

Upvotes: 1

Related Questions