In the previous post we used the XapSignTool directly in order to sign the enterprise application. One of the changes introduced to Windows Phone is the ability for the Windows Phone store to distribute precompiled applications, making them run that much quicker. In order to take advantage of this for your enterprise applications you need to run the MDILXAPCompile tool which ships with the SDK. Luckily, the team have also provided a powershell command making it dead easy to precompile and sign your application in one easy step.
Firstly, you’ll need to run powershell. Depending on how your system is setup you’ll probably want to run it as administrator as you may need to change the execution policy. If you’re familiar with powershell you can probably skip these steps.
Go to C:WindowsSystem32WindowsPowerShellv1.0, right click on Powershell.exe and select Run as Administrator
If you run into errors running the powershell script, with an error referring to execution policy, you can adjust the policy as follows (warning this will allow any script to run):
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
Change directories to the MDILXAPCompile tools folder within the SDK:
cd ‘C:Program Files (x86)Microsoft SDKsWindows Phonev8.0ToolsMDILXAPCompile’
Run BuildMDILXap.ps1
.BuildMDILXap.ps1 –xapfilename ‘c:tempProvisioningSimpleCompanyApp.xap’ –pfxfilename ‘c:tempcompanyappcert.p12’ –password mypassword
The output should look like the following