UWP unit test application launches but it never runs tests or exits
Description
I am attempting to run UWP unit tests using vstest.console.exe. The unit test application successfully deploys and launches but it never runs any unit tests (I placed a break point in a test and it was never hit) or completes. The unit test application UI stays until it is manually closed. The OS it is failing on is Windows Server 2016. The latest version of VS2015 and UWP tools are installed on the VM. I get the same result when I run unit tests from the VS2015 UI as I do when calling vstest.console.exe directly.
The same tests successfully pass on my Win10 development environment so I'm guessing it is something environmental about Windows Server 2016 - or how it is configured - that is causing the tests to never pass.
Steps to reproduce
- Windows Server 2016
- Open VS2015 and create new UWP test project
- Execute tests in UWP test project
Expected behavior
- Tests execute, runner closes, results are reported in VS2015
Actual behavior
- Test runner never executes tests or closes
Environment
Windows Server 2016 VS2015
Runner hangs open like this:

@JamesNK . Did this ever work in Windows Server 2016
SampleTest.zip @JamesNK I uploaded a zip file with 2 projects - SampleTcpServer, TcpClientApp. SampleTcpServer is a simple desktop console app which launches a TCP server and waits for connection. TcpClientApp project is a UWP blank app project which contains a TCP client and connects to the desktop TCP server.
- Start the Server app first. It should say - Hosting @ 127.0.0.1....
- Start the TCP client app (Ctrl + F5) from VS - Click "Connect Server" button on the app ui. It should either say - "Connection Established" or throw some error relating to connection failure.
This would help us diagnose the issue. we use a simple TCP server-client model like this to trigger test run after the test app launches. My guess is that connection is not happening and our UWP test app is forever waiting on the connection.
I ended up deleting the Server 2016 VM and replacing it with a Win10 VM that doesn't have any issues. I can't give any more information.
Is there any other solution someone can recommend? I am encountering the same exact problem. Additionally, when I try to view the tests with /ListTests, I get this output:
Error: An exception occurred while test discoverer 'MSAppContainerTestDiscoverer' was loading tests. Exception: Specified method is not supported.
Error: An exception occurred while test discoverer 'MSPhoneTestDiscoverer' was loading tests. Exception: Specified method is not supported.
Additionally, the UWP Tests work with no issues on Windows 10, so it appears to be something with Windows Server 2016. Only difference with above post is that I have VS2017 on the VM.
I would really like to avoid the need to provision entirely new VMs for this.
@saikrishnav I have the same issue, here is the error message from your test App : System.ServiceModel.EndpointNotFoundException: 'No IPEndpoints were found for host 127.0.0.1.' I hope it will help to find the root cause of this issue.
This is being tracked external to this repo here: https://developercommunity.visualstudio.com/content/problem/145941/uwp-unit-test-application-launches-but-it-never-ru.html
@JamesNK , the issue is because we use wfc communication over sockets to connect UWP app with VS IDE / vstest.console. For some it seems that connection is blocked.
However in V2017.5 we have introduced a new Testplatform, which uses raw sockets to establish communication. For UWP it is still underneath a feature flag, & we plan to make it default by 15.6 It works fine with UWP test apps.
To try out the preview bits of this for UWP, please edit your csproj, & change value of "UnitTestPlatformVersion" to 15.5, please clean, & do a rebuild.