TFS Build for Windows 8 app package: The certificate specified has expired

We’ve been building several Windows 8 / 8.1 projects on TFS for quite a while now. Several of these apps are company apps and thus don’t have a store certificate but still use the Visual Studio test certificate in development. But after a year of happy coding, the test certificate expires. Local machine builds still happen and you can continue to debug, but your TFS build will fail with following error.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets (1538):
    The certificate specified has expired. For more information about renewing certificates, 

The fix is fast and easy, just open Package.appxmanifest, go to the Packaging tab, click Choose Certificate… and generate a new test certificate.

VS 2013 Package certificate

Be sure to generate a new test certificate without password, or you’ll end up with the following error instead.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets (1538): 
    Cannot import the key file 'Calidos.Phebus.Noe3.TestClient_TemporaryKey.pfx'. The key file may be password protected.
    To correct this, try to import the certificate manually into the current user's personal certificate store.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets (1538):
    A certificate with thumbprint '30516C3FDC96C870A0246824101AC9F3E5ED1D4F' that is specified in the project cannot be found
    in the certificate store. Please specify a valid thumbprint in the project file.

More info on certificates for signing an app package.

Licensed under CC BY-NC-SA 4.0; code samples licensed under MIT.
comments powered by Disqus
Built with Hugo - Based on Theme Stack designed by Jimmy