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