【问题标题】:Implementing Windows Phone 8.1 Continuous Deployment via TFS2015 on Windows Server 2012 R2在 Windows Server 2012 R2 上通过 TFS2015 实现 Windows Phone 8.1 持续部署
【发布时间】:2016-09-26 14:29:43
【问题描述】:

我正在尝试为我的 Windows Phone 8.1 (Windows Phone RT) 应用程序设置持续部署。 客户购买了赛门铁克证书,我们将使用它来签署应用程序。 首先,我尝试在本地机器上做所有事情:

  • 安装 TFS2015(我们计划用于从 存储库,构建应用程序并对其进行签名)
  • 为 TFS 安装 HockeyApp(我们将用于部署)插件

我已按以下顺序设置构建步骤:

  1. NuGet 安装程序,
  2. Visual Studio 构建,
  3. 索引来源和发布符号
  4. 发布构建工件
  5. 命令行 (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)
  6. 复制文件(将 appx 文件、appxsym 和 AETX 文件放在一个文件夹中)
  7. 命令行(powershell.exe -ExecutionPolicy Unrestricted -File "ZipAppxUpload.ps1" -folderpath "FolderWhereAppxAndPfxFileAre" -appxuploadname "MyAppName.appxupload") - 在 .appupload 文件中压缩 appx、appxsym 和 aetx 文件
  8. HockeyApp - 将 .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 Server 上签署应用程序时:

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。 任何帮助表示赞赏。

【问题讨论】:

  • 您的意思是当您在 Windows 10 Pro 上安装 TFS 时,您会成功构建?当您安装 TFS Windows Server 2012 R2 时,您不会成功构建?您在哪里部署构建代理?
  • "你的意思是当你在 Windows 10 Pro 上安装 TFS 时,你会成功构建?当你安装 TFS Windows Server 2012 R2 时,你不会成功构建? i>" - 没错 "你的构建代理部署在哪里?" 对于我的本地机器(Win10 Pro),代理已下载、配置并运行从我的本地硬盘驱动器位置。 对于远程 Windows Server,代理(也)被下载、配置并在 Windows Server 计算机的本地硬盘驱动器上运行。
  • 我还能检查什么?我仍然在这里寻找任何可能有问题的地方。

标签: windows-runtime windows-phone-8.1 tfs-2015 continuous-deployment windows-server-2012-r2


【解决方案1】:

由于您的问题发生在 Step5,您需要检查您的构建代理机器,看看您是否可以在 c:\program files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1 中找到文件。另外,请检查您是否在构建代理机器上安装了 windows phone SDK。

【讨论】:

  • 感谢您的输入 Cece,但是安装了 WP SDK(没有模拟器)。此外,powershell 脚本 BuildMDILAPPX.ps1 位于正确的路径中,并且存在于构建代理机器上。
  • 您的意思是当您在 Windows 10 Pro 上安装 TFS 时,您会成功构建?当您安装 TFS Windows Server 2012 R2 时,您将无法成功构建?
  • "你的意思是当你在 Windows 10 Pro 上安装 TFS 时,你会成功构建?当你安装 TFS Windows Server 2012 R2 时,你不会成功构建? i>" - 这是正确的 "你在哪里部署你的构建代理?" - 对于我的本地机器(Win10 Pro),代理已下载、配置和从我的本地硬盘位置运行。对于远程 Windows Server,代理(也)被下载、配置并在 Windows Server 机器的本地硬盘上运行。
  • 我已经在我的机器(Windows Server 2012R2)上尝试了你的步骤,命令运行但只收到一条警告消息“无法将参数绑定到参数'FilePath',因为它为空。”如果您在构建代理机器上手动运行 powershell,您会得到什么结果?另外,检查你的两台机器上的powershell是否是相同的版本。
猜你喜欢
  • 1970-01-01
  • 2017-09-05
  • 1970-01-01
  • 2014-01-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多