4

问题

我正在尝试使用 msix 作为部署方法将 .net core 3.1 wpf 应用程序安装到 Windows 2019 服务器上。Windows 服务器是最新的,应该支持 msix,但不会安装我使用 powershell 命令 Add-AppPackage 创建的任何 msix 包。如果您单击 .appinstaller 文件并使用 gui,这些软件包将安装在 Windows 10 机器上,但如果您使用 powershell,它们将不会安装在同一台机器上。

我试过的

  • 我已经浏览了此故障排除页面,但无济于事。
  • 我尝试了不同的 msix 包
  • 我试过使用本地文件目录
  • 我试过以管理员身份运行

代码

这是我尝试安装的示例: 应用安装程序文件 运行 .appinstaller 文件将正确安装此 uwp 应用程序。但是,这不起作用:

Add-AppPackage .\TestUwp.appinstaller

错误信息

这是 powershell 脚本输出的错误消息:

Add-AppPackage : Deployment failed with HRESULT: 0x80073CF0, Package could not be opened.
error 0x8007000D: Opening the package from location TestUwp.appinstaller failed.
NOTE: For additional information, look for [ActivityId] 742e8080-11e2-0000-5f0b-3374e211d601 in the
Event Log or use the command line Get-AppPackageLog -ActivityID 742e8080-11e2-0000-5f0b-3374e211d601
At line:1 char:1
+ Add-AppPackage .\TestUwp.appinstaller
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (W:\...\.appinstaller:String) [Add-AppxPackage],
   FileNotFoundException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPac
   kageCommand

PS W:\[file location here]> Get-AppPackageLog -ActivityID 742e8080-11e2-0000-5f0b-3374e211d601

Time                      ID           Message
----                      --           -------
4/14/2020 9:17:50 AM      603          Started deployment Add operation on a package with main
                                       parameter TestUwp.appinstaller and Options 0 and 0. See
                                       http://go.microsoft.com/fwlink/?LinkId=235160 for help
                                       diagnosing app deployment issues.
4/14/2020 9:17:50 AM      465          error 0x8007000D: Opening the package from location
                                       TestUwp.appinstaller failed.
4/14/2020 9:17:50 AM      403          error 0x8007000D: Failure to get staging session for:
                                       file:///W:/[file location here]/TestUwp.appinstaller.
4/14/2020 9:17:50 AM      404          AppX Deployment operation failed for package  with error
                                       0x80073CF0. The specific error text for this failure is: error
                                       0x8007000D: Opening the package from location
                                       TestUwp.appinstaller failed.
4

1 回答 1

4

当您使用:

Add-AppxPackage .\TestUwp.appinstaller

路径将映射到位置参数-Path。此参数旨在指定应用程序包的路径。但是您不是直接安装该应用程序。您正在使用应用安装程序文件。要从那里安装,请使用:

Add-AppxPackage -AppInstallerFile .\TestUwp.appinstaller

使用此命令,我能够成功安装您的软件包。

于 2020-04-22T20:17:27.910 回答