I have a Universal Windows Platform (UWP) application, but I am having trouble testing it.

First off, there seems to be some issue with running MSTest in the latest versions of Visual Studio (currently V.S. 2017, 15.5.3) where the test app pops up a window and doesn't close it, never finishes, and doesn't let me run it twice. I've googled and debugged for days with no fix in sight. I've changed runtime versions and target platforms. I've started fresh. I've tried some of my co-workers. We're all having this problem. So MSTest doesn't work with UWP applications. I've also played with mstest.exe via the command line for a few hours and couldn't get it to run, I suspect because of the immaturity of the UWP platform.

That doesn't really matter though, because even if it did, in order to execute my unit tests in a build, I would have to run them in a windowless environment on my build server. TFS can't execute it because it has to pop open a window and there is no GUI running on the company's TFS servers.

I switched to xUnit because of the MSTest issues. Just a bit of rewriting and we're back in business on the unit testing front. xUnit forces me to open the tests in an application window and run it from there because xUnit for Windows Universal doesn't integrate into Visual Studio. That also means I can't run it headlessly on my TFS build/integration server. Again, I'm in the same spot.

So what have I missed? Is there any way to automate my unit testing via TFS build server, or have we simply picked the wrong platform for the job?

  • 1
    Have you seen Set up automated builds for your UWP app. Also checkout DevOps for IoT with Win10 IoT Core, UWP, and VSTS
    – Deleted
    Commented Dec 27, 2018 at 1:20
  • 1
    Thanks, @MickyDuncan . Both of those were written well after I asked, and frankly, I've moved on to different projects, but I am leaving the question up here for posterity. I think you could form a pretty good answer with those links and score some points for yourself :) Commented Jan 8, 2019 at 20:06
  • 1
    Ah this is true good sir. I’ve just started UWP so I’ve been Googling madly and came across your post :)
    – Deleted
    Commented Jan 9, 2019 at 0:55


Browse other questions tagged or ask your own question.