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 中的"System.InvalidOperationException".exe 类型为"System.InvalidOperationException"的异常发生在 完全信任.exe但未在用户代码中处理 进程没有 包标识。(HRESULT的例外:0x80073D54(

UWP:进程没有包标识

对于我的测试,我分别重现了您在运行FullTrust项目的问题,对于此解决方案,您需要运行Package引用FullTrustUWP项目的桌面桥。如果FullTrust在没有LaunchFullTrustProcessForCurrentAppAsync的情况下运行时在不信任进程中运行,则无法FamilyName

最新更新