22

I have a UWP app I work on from two difference devices. After the latest Visual Studio 2019 update I began receiving this error:

No certificate found with the supplied thumbprint: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The app previously had the temporary key Visual Studio used to auto generate that it no longer does. I generated a new key file from the instructions at this link https://learn.microsoft.com/en-us/windows/msix/package/create-certificate-package-signing and that worked on my desktop. I was able to select the certificate in the package manifest, update the "PackageCertificateThumbprint" in the csproj file and then both build and create the sideload package.

Now, switch to my laptop. I get the above errors again even though I've brought the cert I created over to that machine. The package GUI tells me that there isn't a valid cert to use. I've tried adding that cert to the local machine to no avail.

  1. What am I missing that I should be doing?
  2. My goal is to be able to develop on two different workstations without having to do a dance of creating a new cert everytime I switch one or have to update the csproj file every time I switch from one to the other.

This is a personal project, it's not to the point of going to the store but I do need to dev on two boxes and create side load packages for a set of testers.

b.pell
  • 3,873
  • 2
  • 28
  • 39
  • That I don't know, in the end I didn't want to buy a certificate for a hobby project in order to side load or develop on multiple machines where it resided. I ended up converting the project to WPF/.NET Core 3.1. Completely happy with that decision. I also created a self signed cert but at the time Visual Studio continued to give me errors when I'd switch between my laptop/desktop. It's fully possible I didn't have a setting correct (and this was 8-9 months ago so it could be different now). – b.pell Aug 06 '20 at 20:09

4 Answers4

33
  1. Right click the project -> Properties -> Package Manifest
  2. On the Package.appxmanifest go to Packaging tab -> Choose Certificate
  3. In the new window click "Select a Certificate..." if you have one, or create a certificate if you haven't created one (https://learn.microsoft.com/en-us/windows/uwp/packaging/create-certificate-package-signing)

Source - https://github.com/microsoft/AdaptiveCards/issues/3194#issuecomment-516100011

  • Thanks. New install of vs2019 and loaded an api sample to test and learn from. And of course it didn't build. – dcarl661 Sep 09 '21 at 00:13
3

It may old certificate invalid or no Certificate Available, so that we need to create new certificate following way:

  1. Double Click Package.appxmanifest file
  2. Go to the Packaging tab.
  3. the 'Choose Certificate…' button.
  4. Click Create
  5. if Developer Mode is disable kindly enabled
  6. Click OK
  7. Rebuild Project its working fine.
Cananau Cristian
  • 436
  • 2
  • 6
  • 30
2

Unload project. Edit project file. Make sure package cert is the same as the one you intend to use.

When i switched to vs 2019 it switched to an old one.

Going-gone
  • 282
  • 1
  • 14
1

You can try two ways to solve this problem:

  1. Clean solution and restart the visual studio then rebuild the solution.

  2. Delete the test certificate.

Best regards.

Richard Zhang
  • 7,523
  • 1
  • 7
  • 13
  • 1
    Thank you for your response. Cleaning the solution/restart then rebuild didn't work. I can delete the test certificate and then create a new one but I don't want to have to do that every time I switch from my desktop to my laptop. I'm curious why the package manifest UI sees the cert as valid on one machine and allows me to choose it but not on another. – b.pell Aug 22 '19 at 15:28
  • Hi, please check if your certificate is imported into the **Local Computer** -> **Trusted Root Certification Authorities** folder when you install the certificate on your laptop. – Richard Zhang Aug 23 '19 at 00:10
  • It is in Local Computer -> Trusted Root Certification Authorities. The manifest UI still says "No certificates meet the application criteria.". I also changed the thumbprint in the csproj to be the thumbprint of the cert. No go. This cert does work on the other computer. – b.pell Aug 23 '19 at 12:44
  • Hi, you generated the certificate on the A computer and then tried to use it to develop on the B computer and got an error. This may be because some of the feature values in the certificate do not match your target computer. I still recommend that you delete the original certificate in the project when you use the Visual Studio development project on a new computer. If you use **git** for code management, try adding the certificate file to `.gitignore` – Richard Zhang Aug 24 '19 at 13:34
  • 1
    Ok, I would then need to remove or blank out the "PackageCertificateThumbprint" from the csproj file (because it would have conflicting values based on the different certs)? If I have a cert on computer A and set it in the manifest it puts that "PackageCertificateThumbprint" in the csproj file. If computer B has a different cert, that that value no longer matches and has to be removed (which is why I tried to use the same cert). – b.pell Aug 24 '19 at 19:04
  • 2
    You don't have to modify the `csproj` file, usually, you need to rebuild the project. Or set the `PackageCertificateThumbprint` to empty string. – Richard Zhang Aug 25 '19 at 09:40
  • Thank you for your assistance, I appreciate it. Som setting the PackageCertificateThumbprint to empty is what seems to work to let me develop on two boxes and then I have either have to put the cert back in on my desktop when I create a side load package or create a second cert for the laptop (and then use the one for the box I'm on). That's doable, it's just a hassle. – b.pell Aug 31 '19 at 16:03