【问题标题】:UWP: The process has no package identityUWP:进程没有包标识
【发布时间】:2019-11-28 07:47:09
【问题描述】:

我正在研究 UWP-FullTrust 项目,该项目演示了如何将 UWP 与桌面扩展一起使用。代码在以下链接:

https://github.com/StefanWickDev/UWP-FullTrust.git

https://github.com/StefanWickDev/UWP-FullTrust/tree/master/UWP_FullTrust_3

对于 UWP_FullTrust_3 部分,代码下方的最后一行会导致运行时错误。

        public MainWindow()
        {
            InitializeComponent();
            InitializeAppServiceConnection();
        }

        /// <summary>
        /// Open connection to UWP app service
        /// </summary>
        private async void InitializeAppServiceConnection()
        {
            connection = new AppServiceConnection();
            connection.AppServiceName = "SampleInteropService";
            connection.PackageFamilyName = Package.Current.Id.FamilyName;

错误如下。为什么以及如何解决?

抛出异常:FullTrust.exe 中的“System.InvalidOperationException” “System.InvalidOperationException”类型的异常发生在 FullTrust.exe 但未在用户代码中处理 该进程没有 包标识。 (HRESULT 异常:0x80073D54)

【问题讨论】:

    标签: uwp


    【解决方案1】:

    UWP:进程没有包标识

    对于我的测试,我通过单独运行FullTrust 项目来重现您的问题,对于此解决方案,您需要运行引用FullTrustUWPproject 的Package 桌面桥。如果FullTrust在没有LaunchFullTrustProcessForCurrentAppAsync的情况下运行在untrust进程中,则无法得到FamilyName

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      • 1970-01-01
      相关资源
      最近更新 更多