0

我正在嘗試爲Windows Phone 8.1(Windows Phone RT)應用程序建立連續部署。 客戶購買了我們將用於簽署應用程序的Symantec證書。 首先,我試圖做我的本地機器上的所有內容:實現Windows Phone 8.1通過Windows Server 2012 R2上的TFS2015進行連續部署

  • 安裝TFS2015(我們計劃使用從 版本庫中獲取的代碼,構建應用程序,並在簽名)
  • 安裝HockeyApp(我們將使用部署)插件的TFS

我已經安裝在下列順序構建步驟:

  1. 的NuGet安裝,
  2. 的Visual Studio生成,
  3. 指數來源&發佈符號
  4. 發佈構建神器
  5. 命令行(powershell.exe -ExecutionPolicy無限制 - 文件「C:\ Program Files文件(x86)的\微軟的SDK \ WindowsPhoneApp \ v8.1 \ Tools \ MDILXAPCompile \ BuildMDILAPPX.ps1「-appxfilename」AppxPath.appx「-pfxfilename」SymantecCertPath.pfx「-password XXXX -inputFolder」someFolder \ input「-outputfolder」someFOlder \ output「-silent yes)
  6. 複製文件(應對在一個文件夾中籤署appx文件,appxsym和AETX文件)
  7. 命令行(powershell.exe -ExecutionPolicy Unrestricted -File「ZipAppxUpload.ps1」-folderpath「FolderWhereAppxAndPfxFileAre」-appxuploadname「MyAppName.appxupload」) - 壓縮.appupload文件中的appx,appxsym和aetx文件
  8. HockeyApp - deploy .appupload到HockeyApp

我不得不手動簽署應用程序(cmd),因爲我無法通過Visual Studio Community 2015簽名(錯誤:試圖引用不存在的令牌)。我無法解決它。手動簽名是成功的。

我描述的過程在我的本地機器(Windows 10 Pro)上是成功的。 但是,請求是我們在遠程Windows Server 2012 R2上安裝該進程。

我已經安裝了相同版本的TFS和Visual Studio,並且複製了我已經在我的機器上進行的過程(必要的路徑更改)。

我在第五個TFS構建步驟中出現錯誤。

2016-09-23T07:41:32.4673974Z ##[error]Start-Process : This command cannot be run due to the error: The system cannot find the file specified. 
2016-09-23T07:41:32.4673974Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:295 char:15 
2016-09-23T07:41:32.4673974Z ##[error]+ ... $result = Start-Process -FilePath $executable -ArgumentList "$Argum ... 
2016-09-23T07:41:32.4673974Z ##[error]+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
2016-09-23T07:41:32.4673974Z ##[error] + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOperationException 
2016-09-23T07:41:32.4673974Z ##[error] + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand 
2016-09-23T07:41:32.4673974Z ##[error] 
2016-09-23T07:41:32.4673974Z ##[error]breakt : The term 'breakt' is not recognized as the name of a cmdlet, function, script file, or operable program. 
2016-09-23T07:41:32.4673974Z ##[error]Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 
2016-09-23T07:41:32.4830227Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:300 char:8 
2016-09-23T07:41:32.4830227Z ##[error]+  breakt 
2016-09-23T07:41:32.4830227Z ##[error]+  ~~~~~~ 
2016-09-23T07:41:32.4830227Z ##[error] + CategoryInfo   : ObjectNotFound: (breakt:String) [], CommandNotFoundException 
2016-09-23T07:41:32.4830227Z ##[error] + FullyQualifiedErrorId : CommandNotFoundException 
2016-09-23T07:41:32.4830227Z ##[error] 
2016-09-23T07:41:33.5767751Z ##[error]Get-Content : Cannot find path 'D:\...\AppxManifest.xml' because it does 
2016-09-23T07:41:33.5767751Z ##[error]not exist. 
2016-09-23T07:41:33.5767751Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:464 char:31 
2016-09-23T07:41:33.5767751Z ##[error]+  [xml]$Manifestxml = [xml](Get-Content "$appxmanifestpath") 
2016-09-23T07:41:33.5767751Z ##[error]+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
2016-09-23T07:41:33.5767751Z ##[error] + CategoryInfo   : ObjectNotFound: (D:\...ppxManifest.xml:String) [Get-Content], ItemNotFoundEx 
2016-09-23T07:41:33.5767751Z ##[error] ception 
2016-09-23T07:41:33.5767751Z ##[error] + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand 
2016-09-23T07:41:33.5767751Z ##[error] 
2016-09-23T07:41:33.5767751Z ##[error]You cannot call a method on a null-valued expression. 
2016-09-23T07:41:33.5767751Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:466 char:5 
2016-09-23T07:41:33.5767751Z ##[error]+  $Manifestxml.$node.Identity.SetAttribute("Publisher", "$pfxsubjec ... 
2016-09-23T07:41:33.5767751Z ##[error]+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
2016-09-23T07:41:33.5767751Z ##[error] + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
2016-09-23T07:41:33.5767751Z ##[error] + FullyQualifiedErrorId : InvokeMethodOnNull 
2016-09-23T07:41:33.5767751Z ##[error] 
2016-09-23T07:41:33.5767751Z ##[error]You cannot call a method on a null-valued expression. 
2016-09-23T07:41:33.5767751Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:467 char:5 
2016-09-23T07:41:33.5767751Z ##[error]+  $Manifestxml.Save("$appxmanifestpath") 
2016-09-23T07:41:33.5924006Z ##[error]+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
2016-09-23T07:41:33.5924006Z ##[error] + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
2016-09-23T07:41:33.5924006Z ##[error] + FullyQualifiedErrorId : InvokeMethodOnNull 
2016-09-23T07:41:33.5924006Z ##[error] 
2016-09-23T07:41:33.5924006Z ##[error]Start-Process : This command cannot be run due to the error: The system cannot find the file specified. 
2016-09-23T07:41:33.5924006Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:345 char:15 
2016-09-23T07:41:33.5924006Z ##[error]+ ... $result = Start-Process -FilePath $executable -ArgumentList $Argume ... 
2016-09-23T07:41:33.5924006Z ##[error]+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
2016-09-23T07:41:33.5924006Z ##[error] + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOperationException 
2016-09-23T07:41:33.5924006Z ##[error] + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand 
2016-09-23T07:41:33.5924006Z ##[error] 
2016-09-23T07:41:33.5924006Z ##[error]Start-Process : This command cannot be run due to the error: The system cannot find the file specified. 
2016-09-23T07:41:33.5924006Z ##[error]At C:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:430 char:15 
2016-09-23T07:41:33.5924006Z ##[error]+ ... $result = Start-Process -FilePath $executable -ArgumentList $Argume ... 
2016-09-23T07:41:33.5924006Z ##[error]+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
2016-09-23T07:41:33.5924006Z ##[error] + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOperationException 
2016-09-23T07:41:33.5924006Z ##[error] + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand 
2016-09-23T07:41:33.5924006Z ##[error] 
2016-09-23T07:41:33.6548990Z ##[error]Process completed with exit code 0 and had 3 error(s) written to the error stream. 

當我試圖通過註冊CMD與Windows服務器上的應用程序(如管理員):

powershell.exe -ExecutionPolicy Unrestricted -File "c:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1" -appxfilename "AppxPath.appx" -pfxfilename "SymantecCertPath.pfx" -password XXXX -inputFolder "someFolder\input" -outputfolder "someFOlder\output" -silent yes 

我得到了同樣的錯誤:

Start-Process : This command cannot be run due to the error: The system cannot 
find the file specified. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:295 char:15 
+ ... $result = Start-Process -FilePath $executable -ArgumentList "$Argum ... 
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOp 
    erationException 
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C 
    ommands.StartProcessCommand 

breakt : The term 'breakt' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or 
if a path was included, verify that the path is correct and try again. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:300 char:8 
+  breakt 
+  ~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (breakt:String) [], CommandNotFo 
    undException 
    + FullyQualifiedErrorId : CommandNotFoundException 





Get-Content : Cannot find path 
'D:\...\AppxManifest.xml' 
because it does not exist. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:464 char:31 
+  [xml]$Manifestxml = [xml](Get-Content "$appxmanifestpath") 
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (D:\...ppxManifest.x 
    ml:String) [Get-Content], ItemNotFoundException 
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCo 
    ntentCommand 

You cannot call a method on a null-valued expression. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:466 char:5 
+  $Manifestxml.$node.Identity.SetAttribute("Publisher", "$pfxsubjec ... 
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId : InvokeMethodOnNull 

You cannot call a method on a null-valued expression. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:467 char:5 
+  $Manifestxml.Save("$appxmanifestpath") 
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId : InvokeMethodOnNull 



Start-Process : This command cannot be run due to the error: The system cannot 
find the file specified. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:345 char:15 
+ ... $result = Start-Process -FilePath $executable -ArgumentList $Argume ... 
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOp 
    erationException 
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C 
    ommands.StartProcessCommand 



Start-Process : This command cannot be run due to the error: The system cannot 
find the file specified. 
At C:\program files (x86)\Microsoft 
SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1:430 char:15 
+ ... $result = Start-Process -FilePath $executable -ArgumentList $Argume ... 
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOp 
    erationException 
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C 
    ommands.StartProcessCommand 

我有PowerShell的我的本地機器上安裝了5.1版本,Windows Server上安裝了Powershell 5.0版本。

我在簽署過程中在做什麼錯?該過程完全從我的機器複製到遠程Windows Server。 任何幫助表示讚賞。

+0

你的意思是當你在Windows 10 Pro上安裝TFS時,你會成功構建?當你安裝TFS Windows Server 2012 R2時,你不會成功構建?你在哪裏部署你的構建代理? –

+0

「_你的意思是當你在Windows 10 Pro上安裝TFS時,你將獲得成功的構建?當你安裝TFS Windows Server 2012 R2時,你將無法成功構建?_」 - **這是正確的** 「_Where你部署生成代理?_」 **對於我的本地機器(Win10專業版),代理下載,配置並從我的本地硬盤驅動器的位置運行。** **對於遠程Windows服務器,代理程序已(也)下載,配置並在Windows Server計算機的本地硬盤驅動器上運行。** – Slavisa

+0

我還能檢查什麼?我仍然在尋找任何可能出錯的地方。 – Slavisa

回答

0

由於您的問題發生在Step5上,您需要檢查您的構建代理計算機,以查看您是否可以在c:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1中找到文件。另外,請檢查您的生成代理機器上是否安裝了Windows Phone SDK。

+0

感謝您輸入Cece,但WP SDK已安裝(沒有模擬器)。另外,PowerShell腳本BuildMDILAPPX.ps1的路徑正確,並且存在於構建代理機器上。 – Slavisa

+0

你的意思是當你在Windows 10 Pro上安裝TFS時,你會成功構建?當你安裝TFS Windows Server 2012 R2時,你不會成功構建? –

+0

「_你的意思是當你在Windows 10 Pro上安裝TFS時,你將獲得成功的構建?當你安裝TFS Windows Server 2012 R2時,你不會成功構建?_」 - **這是正確的** 「_您在哪裏部署了您的構建代理?_」 - **對於我的本地計算機(Win10 Pro),代理將從本地硬盤位置下載,配置並運行。對於遠程Windows Server,代理程序已(也)被下載,配置並在Windows Server計算機的本地硬盤驅動器上運行。** – Slavisa