我完全陷入了这个问题.所以我的团队在服务测试项目中有一个单元测试项目.测试在测试资源管理器窗格中发现,但是当我尝试运行测试时,我得到以下错误:
'找到了具有相同uri'executor:// xunit/VsTestRunner2'的多个测试适配器.忽略适配器'Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner'.请卸载冲突的适配器以避免此警告'
'[xUnit.net 00:00:00.0251250]跳过:(找不到依赖性组装 'Microsoft.Extensions.DependencyModel,版本= 1.1.0')'
'C:\中没有可用的测试.确保已注册测试发现者和执行者,并且平台和框架版本设置是合适的,然后重试.
上下文信息:
我的测试项目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"
}
}
}
Run Code Online (Sandbox Code Playgroud)
奇怪的是它适用于我的团队成员.但不是我.我们环境的不同之处在于:来自Windows和Visual Studio的最新更新,而它们只是一个或两个更新.
有没有人知道一个解决方法?