Unit testing “现场单元测试不起作用”;未能初始化客户端代理:无法连接到测试进程;

Unit testing “现场单元测试不起作用”;未能初始化客户端代理:无法连接到测试进程;,unit-testing,visual-studio-2017,live-unit-tests,Unit Testing,Visual Studio 2017,Live Unit Tests,尝试在VS 2017上激活实时单元测试时,我遇到以下错误: [TestRunner 1] Failed to initialize client proxy: could not connect to test process. FatalError - System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatf

尝试在VS 2017上激活实时单元测试时,我遇到以下错误:

 [TestRunner 1] Failed to initialize client proxy: could not connect to test process.
FatalError - System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Failed to initialize client proxy: could not connect to test process.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.InitializeExtensions(IEnumerable`1 sources)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
针对此错误的其他类似解决方案说,可能是权限问题,所以我已经尝试以管理员身份运行VS2017,但这不起作用。其他解决方案说,我需要以不同的方式运行测试,但这是用于实时单元测试,所以我认为它们不是可行的选择。我甚至从已经存在的单元测试项目中创建了一个新的单元测试项目,但是我仍然得到这个错误

更新:
这些测试位于运行在VS2017企业版上的MsTest V2测试项目中,该项目正在使用Git版本控件测试.Net framework 4.5.2下的MVC网页项目。

在我的案例中,问题是由于我的runsettings文件配置错误引起的


如果您使用testsettings,请尝试在不使用它的情况下执行测试。

您正在运行什么类型的单元?MsTest、MsTest V2、nUnit、xUnit等?您是否尝试在visual studio上进行修复?Visual Studio 2017的哪个版本?什么类型的项目?现在第一次尝试使用实时单元测试,我在VS 15.4、.NET 4.6.2、NUnit 3.8.1和NUnit测试适配器3.8.0中遇到了相同的错误