question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TestHost.dll discovery does not work on the Mac

See original GitHub issue

Description

Steps to reproduce

Visual Studio for Mac uses the test discovery protocol to discover tests. It currently uses an old 15.5 version but we were looking to update. Using vstest 16.4.0 in VS Mac and test discovery no longer works. It seems that the testhost.dll path is not determined when not on Windows and dotnet fails since no testhost.dll path is being used.

Expected behavior

.NET Core xUnit tests can be discovered and run in VS Mac.

Actual behavior

Test discovery fails.

Test Discovery Console output in VS Mac has:

Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: The application to execute does not exist: ''
. Please check the diagnostic logs for more information.
  at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowExceptionOnConnectionFailure (System.Int32 connTimeout) [0x00074] in <6ce2e22cf5c344a4a7f798b25098ce9c>:0 
  at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel (System.Collections.Generic.IEnumerable`1[T] sources, System.String runSettings) [0x0028d] in <6ce2e22cf5c344a4a7f798b25098ce9c>:0 
  at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests (Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.DiscoveryCriteria discoveryCriteria, Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.ITestDiscoveryEventsHandler2 eventHandler) [0x00015] in <6ce2e22cf5c344a4a7f798b25098ce9c>:0 

The code in 16.4 compared with 16.2 has been changed so the test host path is no longer resolved.

https://github.com/microsoft/vstest/blob/7f90ebbd9e2ab63538a0d16d11a5915c67632a0a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs#L225

Diagnostic logs

failed: https://gist.github.com/mrward/caed5cbbd4633be5c1c2674549cb5162

Environment

macOS 10.15.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rouke-broersmacommented, Jul 25, 2022

I am not, this was fixed by the mentioned release.

0reactions
Evangelinkcommented, Jul 25, 2022

@mrward @rouke-broersma Are you still impacted by this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

vstest 16.4.0 vstest.console process failed to connect ...
vstest.console and testhost are extracted from Microsoft.TestPlatform. ... TestHost.dll discovery does not work on the Mac #2260.
Read more >
Visual Studio Mac does not close dotnet process ...
A fix for this issue has been released! Install the most recent release from https://visualstudio.microsoft.com/downloads/. Thank you for ...
Read more >
Unable to find testhost.dll. Please publish your test project ...
I've fixed it in the same way. Downgrade of xUnit.runner.visualstudio package to 2.4.1 was solve problem. – Jacek Labuda. Jun 8, 2020 at...
Read more >
Problems with .NET unit testing
OS version, for example, Windows 10 or Mac OS X 10.8 · JetBrains Rider version: Help -> About · Unit testing framework version,...
Read more >
Failed Tests in DevOps Pipeline due to "could not find ...
Reinstall .NET Core runtime: If the problem persists, you can try reinstalling the .NET Core runtime on your build machine. You can download...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found