问题所在
我试图在Windows2019服务器上安装一个.net核心3.1WPF应用程序,使用m6作为部署方法。windows服务器是最新的,应该支持m6,但不会安装我使用powershell命令AppPackage创建的任何m6包。如果您单击.appinstaller文件并使用gui,这些包将安装在windows 10机器上,但如果使用powershell,它们将不会安装在同一台机器上。
我试过的
代码
这是我试图安装的一个例子:
运行.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.
发布于 2020-04-22 20:17:27
当你使用:
Add-AppxPackage .\TestUwp.appinstaller
路径将映射到位置参数-Path
。此参数用于指定app包的路径。但是你并不是直接安装这个应用程序。您正在使用应用程序安装程序文件。若要从中安装,请使用:
Add-AppxPackage -AppInstallerFile .\TestUwp.appinstaller
使用此命令,我能够成功地安装您的软件包。
https://stackoverflow.com/questions/61210352
复制相似问题