Visual Studio中的程序包部署陷入困境

时间:2019-10-02 09:42:42

标签: .net visual-studio winforms powershell uwp

使用Windows Application Packaging Project进行我的第一个.NET WinForms迁移到UWP的工作,并进行了几天的部署和清理工作,然后突然停滞了最新的部署。

@echo on
setlocal enableDelayedExpansion
for /r %%F in (*-24px*) do (
  set filename="%%~nxF"
  ren "%%F" "!filename:-24px=lol!"
)

花了很长时间,我不得不取消,然后它记录了事件。

1>------ Deploy started: Project: XXXXXXUwp, Configuration: Debug x64 ------
Starting local deployment...
Deploy: START
DeployAsync: START
Reading package recipe file "J:\projects\XXXXXX\XXXXXX-ui\xxx\installer\XXXUpdater\XXXXXXUwp\bin\x64\Debug\XXXXXXUwp.build.appxrecipe"...
Shutting down application: "XXXXXX_1.0.5.0_x64__8pg3jxqw35kvc"
Deployment layout folder location: "J:\projects\XXXXXX\XXXXXX-ui\xxx\installer\XXXUpdater\XXXXXXUwp\bin\x64\Debug\AppX"
Unregistering application "XXXXXX_1.0.5.0_x64__8pg3jxqw35kvc" currently installed at "J:\projects\XXXXXX\XXXXXX-ui\xxx\installer\XXXUpdater\XXXXXXUwp\bin\x64\Release\AppX" not by Visual Studio deployment.
Unregistering application: "XXXXXX_1.0.5.0_x64__8pg3jxqw35kvc"

不太确定是什么原因导致此问题被卡住,但我怀疑这是由于缺少安装位置“ J:\ projects \ XXXXXX \ XXXXXX-ui \ xxx \ installer \ XXXUpdater \ XXXXXXUwp \ bin \ x64 \ “ Release \ AppX” w / c,似乎我已经手动清理了。

即使Visual Studio已经以管理员身份运行,也会发生这种情况。

我还尝试通过Powershell(以admin身份运行)删除该软件包,并且该软件包也卡住了-我让它过夜运行,希望它花很长时间,但对第二天下午回来感到失望仍然没有进展。 enter image description here

我也尝试制作一个新的.appx,然后运行它来更新当前安装的.appx,但是它也被卡住了10%的更新 enter image description here

更新:我更改了程序包名称,然后尝试部署,但是它卡在了这里:

DEP4000: Deployment was canceled. 
Deploy: DeploymentSucceeded = False
Deploy: DeploymentError = Err_Deploy_Canceled
Deploy: DeploymentHRESULT = 2147500036
Deploy: HasSharedCode = False
Deploy: Target.Id = 512
Deploy: ProjectGuid = {****}
Deploy: Project.TargetPlatformVersion = 10.0.17763.0
Deploy: Project.TargetPlatformMinVersion = 10.0.17134.0
Deleting file "vs.appxrecipe" from layout...
DeployAsync: END (Failure, 0:02:51.321)
Deploy: END (Failure, 0:02:51.336)
1>Deployment of the application to the target device failed
========== Build: 0 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

1 个答案:

答案 0 :(得分:1)

由于尝试卸载程序包后该程序包仍然存在,因此我们认为是由于程序包数据未完全清除。请尝试使用以下PowerShell命令:Get-AppxPackage -allusers PackageFullName | Remove-AppxPackage可以从所有用户帐户中卸载应用程序。

使用上述命令时,卸载应用程序会花费一些时间,如果在完成命令后看到任何错误,则可能需要重新启动计算机。

谢谢。