How do you run Universal Windows (UWP) unit test projects from the command line?
I am using the MSTestFramework.
Short answer:
vstest.console.exe /Platform:x64 AppPackagesUnitTestProject1_1.0.0.0_x64_Debug_TestUnitTestProject1_1.0.0.0_x64_Debug.appx
Long answer:
Create the project by selecting Universal / Unit Test App (Universal Windows) template:
Build it with command line using in the folder where the solution file is
msbuild /p:Platform=x64;Configuration=Debug
Try running the vstest.console.exe command above, in the short answer. It will fail, giving the following error message:
vstest.console.exe
error 0x800B0109: The root certificate of the signature in the app package or bundle must be trusted.. For more details look into Event Viewer under Applications and Services Logs -> Microsoft -> Windows -> AppXDeployment-Server -> Microsoft-Windows-AppXDeploymentServer/Operational.
To be able to run tests from command line, you need to use a certificate which has trusted root, or make the certificate that generated by visual studio trusted. For the latter, double click UnitTestProject1_TemporaryKey.pfx file from windows explorer, and follow the import wizard default steps, but change two things:
UnitTestProject1_TemporaryKey.pfx
1.4m articles
1.4m replys
5 comments
57.0k users