Tuesday 11 November 2014

Multi-Device Hybrid Applications - The certificate specified has expired exception

I ran into a rather nasty little problem when trying to build my multi-device hybrid application yesterday. Out of the blue the build started to fail with the following exception message:

Error 3 The certificate specified has expired. For more information about renewing certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [D:\dev\client\source\myApp\bld\Debug\platforms\windows8\CordovaApp.jsproj] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets 1772

I had just been trying to deploy the application to a device for the first time and thought I may have done something to mess up the certificate when I deployed to my local machine and then uninstalled the deployment. As it turns out this wasn't the case. I eventually posted a question on stackoverflow and was surprised to get a response with the answer so quickly.

Apparently, due to some coding error, the Windows Cordova platform has a temporary key that expired on 11/11/2014.  Microsoft is actively working on resolving the issue.

In the interim, the solution as explained in the answer to my question on stackoverflow is to create a new key and use this in your multi-device hybrid application.  To create a new key simply create a new Windows Store project in Visual Studio.  You will find the key in the root directory of the project. It's the file ending _TemporaryKey.pfx.  At this point the answer on stackoverflow wasn't immediately clear to me.  So just to clarify if you also found the answer a little bit confusing.  What you need to do is.


  • Rename the key from the Windows Store application (the _TemporaryKey.pfx) to Cordova_TemporaryKey.pfx.
  • In your multi-device hybrid application project navigate to the res/cert folder and add a folder windows8 (CTP1 and CTP2, see stackoverflow answer for CTP3 folder location).
  • Copy the Cordova_TemporaryKey.pfx into the res/cert/windows8 folder.
That should be all you need to do.  Now when you build you application this temporary key will be used when creating the certificate.


No comments:

Post a Comment