Why Visual Studio 2022 Enterprise unit tests don't work in my new Windows 11 laptop?
Just creating an empty XUnit C# Unit test project fails miserably when trying to run or discover the tests with this error:
Microsoft.TestPlatform.VsTestConsole.TranslationLayer.TransationLayerException: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\ServiceHub\Hosts\ServiceHub.Host.AnyCPU\ServiceHub.TestWindowStoreHost.exe process failed to connect to vstest.console process after 90 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout.
at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.WaitForConnection()
at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.EnsureInitialized()
at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.DiscoverTests(IEnumerable1 sources, String discoverySettings, TestPlatformOptions options, ITestDiscoveryEventsHandler2 discoveryEventsHandler) at Microsoft.VisualStudio.TestWindow.Messaging.RemoteAgent.BaseTestAgentBridge.DiscoverTestsAsync(IEnumerable
1 sources, String discoverySettings, RemoteTestPlatformOptions options)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProvider.<DiscoverTestsAsync>d__18.MoveNext()