[UWP] IBackgroundTask中的FullTrustProcessLauncher无法正常工作 [英] [UWP]FullTrustProcessLauncher in IBackgroundTask not working

查看:347
本文介绍了[UWP] IBackgroundTask中的FullTrustProcessLauncher无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试启动  FullTrustProcess  来自
我的后台任务。为此,我打电话给我  await
FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
,但它告诉我  FullTrustProcessLauncher
在此上下文中不存在
。我尝试添加  Windows
UWP的桌面扩展
   Windows.ApplicationModel.FullTrustAppContract  引用
到我的后台任务,但后来我无法编译它以进行发布(除非我禁用.Net原生工具链。我得到的错误是:  内部
编译器错误:已添加具有相同键的项目。

I am trying to launch a FullTrustProcess from my Background task. For this I am calling await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();, but it tells me FullTrustProcessLauncher does not exist in this context. I have tried adding Windows Desktop Extensions for the UWP and Windows.ApplicationModel.FullTrustAppContract references to my Background task, but then I am not able to compile it for release (Unless I disable .Net native toolchain). The error I then get is: Internal compiler error: An item with the same key has already been added.


如何解决此问题?我的后台任务需要以某种方式启动WPF组件。是否有解决方法,如启动没有窗口的UWP前台应用程序?或者我是否有导入/权限错了吗?请注意,我似乎只需要添加其中一个引用,
但两者都不起作用。

How can I fix this? My background task needs to somehow launch the WPF component. Is there a workaround, like launching a UWP foreground app without a window? Or do I have an import/permission wrong? Note that I only seem to need to add one of the references, but with both it does not work.

推荐答案

这是什么操作系统版本和目标版本?

What's the OS version and target version for this?

这应该在后台任务中工作,因为它是一个Windows运行时组件,并且您已经为UWP添加了Windows桌面扩展。

This should work in the background task as it is a Windows Runtime Component and you had added the Windows Desktop Extensions for the UWP.

是否有针对此问题的示例?可以吗?与我分享?

Is there a sample for this issue? Could you please share me with it?

祝你好运,

Roy


这篇关于[UWP] IBackgroundTask中的FullTrustProcessLauncher无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆