UWP:该过程没有程序包标识

时间:2019-11-28 07:47:09

标签: uwp

我正在研究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)

1 个答案:

答案 0 :(得分:0)

  

UWP:该过程没有程序包标识

对于我的测试,我将分别与运行FullTrust项目一起重现您的问题,对于此解决方案,您需要运行PackageFullTrust项目的运行UWP桌面桥。如果FullTrust在没有LaunchFullTrustProcessForCurrentAppAsync的情况下以不受信任的方式运行,则无法获得FamilyName