问题
I've just got my certificate to sign Windows Phone Apps and when I try to run this command:
XapSignTool.exe sign /v C:\Temp\MyApp_Release_AnyCPU.xap
I'm using Visual Studio 2012 Express.
I get an strange behavior:
The following certificate was selected: Issued to: XXXXXX Issued by: Symantec Enterprise Mobile CA for Microsoft Expires: XXXXXX SHA1 hash: XXXXX Done Adding Additional Store Successfully signed: C:\Users\Fernando\AppData\Local\Temp\tmp7E47.tmp\MyApp.dll Number of files successfully Signed: 1 Number of warnings: 0 Number of errors: 0
The following certificate was selected: Issued to: XXXXXX Issued by: Symantec Enterprise Mobile CA for Microsoft Expires: XXXXXX SHA1 hash: XXXXXX Done Adding Additional Store Number of files successfully Signed: 0 Number of warnings: 0 Number of errors: 1
SignTool Error: This file format cannot be signed because it is not recognized. SignTool Error: An error occurred while attempting to sign: C:\Users\Fernando\Ap pData\Local\Temp\tmp7E48.tmp\MyApp_Release_AnyCPU.xap
XapSignTool Error: signtool.exe failed with exit code 1.
Timers: Main:528.4ms ExtractZip(C:\Temp\MyApp_Release_AnyCPU.xap):198.5ms Signing PE files:120.4ms LaunchSignTool(C:\Users\Fernando\AppData\Local\Temp\tmp7E47.tmp\MyApp.dll): 93.0ms CreateXap(C:\Temp\MyApp_Release_AnyCPU.xap):107.5ms Signing XAP file:-63524687248290.1ms LaunchSignTool(C:\Users\Fernando\AppData\Local\Temp\tmp7E48.tmp\MyApp_Release_AnyCPU.xap):56.0ms
CleanUp:6.2ms
Can anyone help me? Sounds weird to me...
回答1:
Yes, F.D.F Dev is right, with x86 folder works...
I had the same problem (error 1 with signtool.exe) when trying to sign a 8.1 xap file. In my case, I made it also work with x64 folder by updating Microsoft Silverlight to last version (from 5.1.20513.0 to 5.1.30514.0)
回答2:
It seems I was trying to use signtool.exe from x64 folder. Using the one from x86 folder works ok!
回答3:
I had this working before. After one of the Visual Studio 2015 updates I started getting this error.
I was already using the x86 version of the signing tool.
Installed the latest version of Silverlight from Microsoft: https://www.microsoft.com/silverlight/
And magic it was working. Not sure why.
I got this answer from the following blog: http://www.gep13.co.uk/blog/strange-error-when-signing-xap-file-for-windows-phone-8-1-silverlight-application/
Hope this helps.
来源:https://stackoverflow.com/questions/20970686/error-signing-windows-phone-xap-file-signtool-error-this-file-format-cannot