vstest: Failed to negotiate protocol. Wait for response timeout
I tried to run NUnit test cases in Visual Studio 2017 15.7.1 and I got this exception.
[5/17/2018 12:31:26 PM Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=OperationSetFinished, operationInProgress=False
[5/17/2018 12:31:26 PM Diagnostic] TestDiscoveryStats.OperationStateChanged State=OperationSetFinished, InProgress=False
[5/17/2018 12:31:26 PM Error] Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Failed to negotiate protocol. Wait for response timed out.
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.CheckVersionWithTestHost()
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, CancellationToken cancellationToken)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
[5/17/2018 12:31:26 PM Error] Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Failed to negotiate protocol. Wait for response timed out.
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.CheckVersionWithTestHost()
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, CancellationToken cancellationToken)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
[5/17/2018 12:31:26 PM Diagnostic] Cancel requested, actions left in queue 1, exiting...
[5/17/2018 12:31:26 PM Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=TestExecutionCanceling, operationInProgress=False
[5/17/2018 12:31:26 PM Diagnostic] TestDiscoveryStats.OperationStateChanged State=TestExecutionCanceling, InProgress=False
[5/17/2018 12:31:26 PM Diagnostic] *** Run finished using 'InMemoryUnitTestWriter' ***
[5/17/2018 12:31:26 PM Informational] ========== Run test finished: 0 run (0:01:00.47631) ==========
[5/17/2018 12:31:26 PM Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=TestExecutionCancelAndFinished, operationInProgress=False
[5/17/2018 12:31:26 PM Diagnostic] TestDiscoveryStats.OperationStateChanged State=TestExecutionCancelAndFinished, InProgress=False==========
Here are the package and versions I’m using in the project
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSdkVersion)" />
<MicrosoftTestSdkVersion>15.8.0-preview-20180510-03</MicrosoftTestSdkVersion>
<NUnitVersion>3.10.1</NUnitVersion>
<NUnitTestAdapterVersion> 3.10.0</NUnitTestAdapterVersion>
I’ve also tried latest release 15.7.2 but still got the same exception
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 33 (17 by maintainers)
@alexsaare I have seen the “Failed to negotiate protocol” error when testing something with a reference to System.Reflection.TypeExtensions v4.5.0 and a target framework of netcoreapp1.0 or netcoreapp1.1 (2.0 and 2.1 work fine), but for some reason the problem doesn’t happen when I reference System.Reflection.TypeExtensions v4.4.0 or lower - that works on all target frameworks for me.
@alexsaare Thanks for update 👍 Good to know that now you don’t have to re install windows 😄
Still waiting for the others to get back in the office however, in the mean time… the stack trace you posted above got my brain thinking.
We used to have a reference to System.Reflection.TypeExtensions however, this was removed. In visual studio when I clicked on Manage NuGet Dependencies it was showing under the Installed packages. Trying to remove it gave an error saying it was not installed.
Looking at the csproj revealed it was still referenced like this…
This removed the NuGet Issue but the tests still wouldn’t run even after a Clean & Rebuild.
So… I ran dotnet nuget locals all – clear and deleted all everything from C:\Program Files (x86)\Microsoft SDKs\NuGetPackages
I deleted all bin and obj directories then reopened the solution in visual studio. Clean & Rebuild
Problem solved. Unit test run again. I’m not sure how or why those references got in there like that but that seems to have been the issue for me.
Hope this helps someone else.
@smadala Thanks for your assistance with this.
@smadala I did a fully windows reinstallation and the problem was gone…
I was having similar issues with my unit test which was netcoreapp2.0. Building it with net461 would be fine but not netcoreapp2.0 I’ve added following to my project and it fixed it for netcoreapp2.0