How to fix UWP Unit Test error "DEP3000: Attempts to stop the application failed. This may cause the deployment to fail"
Asked Answered
B

2

11

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).

Borneo answered 19/3, 2018 at 4:3 Comment(4)
If it worked on a different PC, I am afraid the problem is really on this particular PC. I would suggest trying full VS uninstall and reinstall as wellIsle
Oh dear. Guess I'll have to. More precious dev hours lost. Will update you on the outcome.Borneo
Sorry about it :-( ... Hope it helps.Isle
I'll let you know if it does, and you can turn your comment into an answer that I can accept/reward.Borneo
I
1

If it works correctly on a different PC, it really seems like a PC-specific problem. I would suggest doing full Visual Studio uninstall and reinstall.

Isle answered 21/3, 2018 at 6:31 Comment(6)
Not sure if this is the issue. We created a brand new VM on Azure, installed latest VS 2017 on it, and same issue as my machine, except on the VM, the unit test app window remains open. But test still continues to run indefinitely without any breakpoints being hit.Borneo
Cannot submit repro as different machines produce different behaviour.Borneo
Any changes on this? It is really very weird :-OIsle
No updates unfortunately :/ Short of contacting Microsoft support, not sure what can be done.Borneo
Uninstall and reinstall - it's just a time wasting (and most useless suggestion in this case)! This issue is wired (somehow) with the PC configuration, especially network adapters presented in the system first, and, of course, because of buggy MS code and improper QA of the releases.Eldenelder
Sorry about that, but when something works on one PC and not on another, reinstall helps pretty often :-D. But if it does not then reporting to vs feedback as a good step.Isle
T
0

I got the same error message

DEP3000: Attempts to stop the application failed. This may cause the deployment to fail. [0xD000A003] Exception from HRESULT: 0xD000A003

I found the process of the app in Task Manager and killed it, then I could start the app without any issue.

Tc answered 14/12, 2020 at 20:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.