How to created a UWP app with a certificate that c

2020-06-17 06:20发布

I am trying to create a UWP app that can be sideloaded onto other PCs. My main question is: Do I need a certificate from a trusted source to sign my application?

After a lot of poking around, I learned that you can sideload/install UWP applications through the application App Installer from the Windows Store. After installing the App Installer, one can install UWP apps by double clicking on the .appxbundle file. (Not using the .ps1 file, as indicated here)

Before doing this, I would need to trust the certificate. I've created this certificate through Visual Studio. It was created by double clicking the .appxmanifest going to Packaging, selecting Choose Certificate -> Configure Cerfiticate and then Create test certificate.

I tried to install my application on two different Windows 10 machines. On one machine, the application would fail by saying that the package might conflict with another package or depends on things that aren't installed (something that isn't true) and on the other machine it would give a certificate error (even though I trusted and added the certificate to my root trusted certificates).

Do I need a certificate released by a trusted authority to get this to work? I was under the impression that my certificate should work, as long as the user trusted it, but the app doesn't seem to install.

Also, if I do need a trusted certificate, how do I create this pfx file? And where do I get it from? The Microsoft documentation doesn't seem to mention anything.

2条回答
smile是对你的礼貌
2楼-- · 2020-06-17 07:09

Make sure you add the certificate to the Trusted People store (that's not a typo -- it is People). The other error can be caused if you don't have the right Framework Packages installed or if you previously installed the app and haven't changed the version number in the manifest.

查看更多
Anthone
3楼-- · 2020-06-17 07:10

It turns out that I didn't have the dependencies installed. I added the certificate to the Local Computer (not Current User) in the Trusted Root Authorities Section. After this I was still getting the error that the package depends on things that weren't installed. This turned out to actually be true! According to the App Installer page

The App Installer does not automatically install framework dependencies. In most cases your device already has the dependencies, but there are some developer or enterprise scenarios where you need an additional framework. In this case just browse to the dependency folder with your app and install the dependency framework just like any app, using the App Installer!

The Dependencies were all located in a folder called "Dependencies" that was created by Visual Studio. After installing those, the App installed successfully!

查看更多
登录 后发表回答