Many developers have recently reported seeing the following error message when they try to compile their UWP projects: “Certificate does not match supplied signing thumbprint: xxxxx”.
Full error message:
1>C:Program Files (x86)Microsoft Visual Studio19ProfessionalMSBuildMicrosoftVisualStudiov16.0AppxPackageMicrosoft.AppXPackage.Targets(821,5): error : Certificate does not match supplied signing thumbprint: 5969de9ae710abeaf66c5d5182ee776c83689dbce
The problem with the inability to compile the project is due to a mismatch between the real thumbprint of the certificate (.pfx) and the corresponding value stored in the project file (.csproj, .vbproj or .vcxproj).
Here is an example with a project I worked on:
Properties of the certificate used:
In this example it’s pretty obvious, the thumbprint stored in the project file is different than the real thumbprint of the certificate.
Why is it new?
This problem can surprise developers since it may occur even if you haven’t modified your project or the certificate used.
This issue is related to a change in the recent update 16.2 of Visual Studio 2019 (released July 24th).
Is it a bug of Visual Studio 2019?
In my opinion, it’s the contrary, it was a legacy bug in Visual Studio 2015, 2017 and the first versions of Visual Studio 2019, all ignoring the property
PackageCertificateThumbprint in the project file and signing the project with the certificate without checking its thumbprint. In addition, it seems like these versions didn’t update the value in the project file when a new certificate was generated.
How to fix this error?
Step 1: Retrieve the thumbprint of your certificate
- In Visual Studio, double click on the `Package.manifest` from your project.
- Click on the
- Click on the
- Click on
View Full Certificateand select the tab
- Finally, click on
Thumbprintand copy the value.
Step 2: Modify your project file
- Using the File Explorer, right click on your project file (
csprojif it’s a C# project,
vbprojfor VB.Net or
vcxprojfor C++), click on
open withand select your favorite text editor.
- Find the xml node
PackageCertificateThumbprintand replace the value by the one you got during step 1.
Source: Rudy Huyn