All versions numbers are shown at the bottom of this question.
When I add a new Unit Test (Universal Windows) project to my solution and build it, it builds fine, and the template TestMethod1
shows up in VS Test Explorer. When I run this test from Test Explorer however, I get the above error, followed by:
Updating the layout...
Deployment complete (0:00:00.502). Full package name: <some long package name>
Breakpoints that I set within TestMethod1
do not get hit when I debug this test and I receive the same error.
The UWP test app launches for a split second then closes, and VS Test Explorer continues trying to run the test indefinitely.
I found this thread, which suggested an issue with network adapters (tried it, didn't work for me): https://developercommunity.visualstudio.com/content/problem/153784/unit-tests-to-not-execute-for-uwp-application.html
Things I've tried so far:
Restarting VS, Clean/Build, removing obj/bin, disabling all network adapters except the ethernet one that's actually being used, removing %TEMP%\VisualStudioTestExplorerExtensions
, running CheckNetIsolation.exe LoopbackExempt -c
, restarting machine, repairing Visual Studio installation, reconsidering my chosen industry.
The Unit Test project references a UWP blank app which itself references a netstadard1.4 project (all vanilla).
Question: How do I fix this error and get the unit test running?
Version numbers:
Visual Studio: Enterprise 2017 15.5.6
UWP target/min: Windows 10 Anniversary Edition (10.0; Build 14393)
NuGet packages: Microsoft.NETCore.UniversalWindowsPlatform v6.0.8, MSTest.TestAdapter v1.2.0, MSTest.TestFramework v1.2.0
Edit 1:
I tried with Visual Studio v15.6.3 on another machine and everything worked fine there so I upgraded this machine to v15.6.3 as well, but it still doesn't work (I get the same error/behaviour).