Can vstest.console.exe run an appx without a secur

2019-06-18 06:48发布

问题:

I'm trying to set up automated builds on my build agent using MSBuild on the command line. The two projects I'm focussed on at the moment are a UWP and it's associated unit test project.

To build, I have to use this:

/p:AppxPackageSigningEnabled=false

Else, I get this error:

error APPX0101: A signing key is required in order to package this project. Please specify a PackageCertificateKeyFile or PackageCertificateThumbprint value in the project file.

However, this does not generate a .cer security certificate. So when I run vstest.console.exe, I get this error:

error 0x800B0100: The app package must be digitally signed for signature validation..

Question: Can vstest.console.exe be made to run without a .cer, and if not, how can I get everything building and my tests running as well? I don't want devs to use temporary .pfx files.

回答1:

A UWP package must be signed, so it should not be able to made to run without a .cer. Please see the Best Practices for Signing Certificates and Create a certificate for package signing topics to create a signing certificate firstly.



回答2:

Actually there is a way to run a UWP unit test using vstest.console.exe without having to install any certificate: Pass to vstest.console.exe the .appxrecipe file instead of the .appx file.

It will deploy the UWP unit test app from its current build location and be able to start the tests.