我正在Visual Studio中创建一个测试项目。它构建,但未能发现项目中的测试,并出现以下错误:
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
错误日志的全文可在此处查看at this Github issue
这是我的project.json文件
"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": {}
}
令人沮丧的是,直到昨天,这个项目已经运行了几个星期,并进行了大约40个左右的测试。任何想法如何解决这个问题?
答案 0 :(得分:4)
好吧,我安装了dotnet-test-xunit软件包,VS Test Explorer现在可以看到并运行我的测试。 Resharper仍然无法找到它们,但我想我们将在整个MSBuild dotnet核心事物被整理之前再经历几次。
答案 1 :(得分:0)
我在升级软件包(nuget)之后遇到了类似的问题,然后通过这个线程解决了(如果你的目标是core和netxxx,则顺序很重要)https://github.com/xunit/xunit/issues/900