I am trying to run Windows Phone 8.1 unit tests from the command line using the vstest.console.exe. I have created a new Windows Phone 8.1 unit test project in VS 2013 (Update 4):
The unit test is discovered in Visual Studio and I am able to run it successfully:
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
Assert.IsTrue(true);
}
}
The next step is to create a new AppPackage
from my test project which generated the desired .appx
file. Then I tried to run the unit test contained in this file using the following command:
vstest.console.exe /InIsolation /settings:Test.runsettings UnitTestApp1_1.0.0.0_x86_Debug.appx
where Test.runsettings
looks like this:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<MSPhoneTest>
<TargetDevice>Emulator WVGA</TargetDevice>
</MSPhoneTest>
</RunSettings>
This command started the emulator but fails with this error:
Error: Installation of package 'D:\work\WP81UnitTestApp\UnitTestApp1\AppPackages\UnitTestApp1_1.0.0.0_x86_Debug_Test\UnitTestApp1_1.0.0.0_x86_Debug.appx' failed with Error: (0xFFFFFFFF) To run unit tests for a Windows Phone app, the app must target Windows Phone 8 or higher..
Any idea what might be wrong?