我完全卡在这个问题上了。我的团队在服务测试项目中拥有一个单元测试项目。测试在测试浏览器窗格中被发现,但是当我尝试运行测试时,出现了以下错误:
“找到具有相同uri“executor://xunit/VsTestRunner2”的多个测试适配器。 忽略适配器'Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner'。请卸载冲突的适配器以避免此警告”
“[xUnit.net 00:00:00.0251250] 跳过:(无法找到相关程序集'Microsoft.Extensions.DependencyModel, Version=1.1.0')”
“C:\中没有可用的测试。确保已注册测试发现器和执行器,并且平台和框架版本设置正确,然后重试。”
上下文信息:
- Xunit 2.2.0
- Visual Studio 15.5.2
- Windows 10 1709 Build: 16299.125
我的测试项目project.json文件:
{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"dotnet-test-xunit": "2.2.0-preview2-build1029",
"Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.3",
"Microsoft.DiaSymReader": "1.0.8",
"Microsoft.DiaSymReader.Native": "1.4.1",
"Microsoft.Extensions.Logging.Abstractions": "1.1.2",
"Microsoft.Extensions.Testing.Abstractions": "1.0.0-preview2-003121",
"Newtonsoft.Json": "9.0.1",
"WebServices": "1.0.0-*",
"xunit": "2.2.0",
"xunit.abstractions": "2.0.1",
"xunit.assert": "2.2.0",
"xunit.core": "2.2.0",
"xunit.extensibility.core": "2.2.0",
"xunit.extensibility.execution": "2.2.0",
"xunit.runner.utility": "2.2.0"
},
"frameworks": {
"net461": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
}
}
奇怪的是这个对我的团队成员有效,但对我无效。我们环境的差异在于:他们的Windows和Visual Studio版本比我更新一两个版本。
有人知道解决方法吗?