Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio dotnet core socket error during test discovery

I am creating a test project in Visual Studio. It builds, but fails to discover the tests in the project with the following error:

Unable to start C:\Program Files\dotnet\dotnet.exe
dotnet-test Error: 0 : [ReportingChannel]: Waiting for message failed System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine

The full text of the error log can be seen here at this Github issue

Here is my project.json file

"version": "1.0.0-*",

"dependencies": {
    "MyProject.Web": {
        "target": "project",
        "version": "1.0.0-*"
    },
    "Moq": "4.6.38-alpha",
    "xunit": "2.2.0-beta3-build3402",
            "xunit.runner.console": "2.2.0-beta3-build3402",
    "xunit.runner.visualstudio": "2.2.0-beta3-build1187"
},

"testRunner": "xunit",

"frameworks": {
    "netcoreapp1.0": {
        "imports": "dnxcore50",
        "dependencies": {
            "Microsoft.NETCore.App": {
                "type": "platform",
                "version": "1.0.0"
            }
        }
    }
},
"runtimes": {
    "win10-x64": {}
}

The frustrating part is that up until yesterday this project had been working fine for a couple of weeks with 40 or so tests. Any ideas how to get past this problem?

like image 774
pthalacker Avatar asked Aug 26 '26 06:08

pthalacker


1 Answers

Well, I installed dotnet-test-xunit package and the VS Test Explorer now sees and runs my tests. Resharper still can't find them, but I imagine we will be going through this a few more times before the whole MSBuild dotnet core thing gets sorted out.

like image 80
pthalacker Avatar answered Aug 31 '26 01:08

pthalacker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!