错误:“此应用程序只能在应用程序容器的上下文中运行." [英] Error: "This application can only run in the context of an app container."

查看:64
本文介绍了错误:“此应用程序只能在应用程序容器的上下文中运行."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有桌面扩展的 UWP 应用,并添加了前面提到的启动任务 此处.(我设置了 Executable="AutoStartupTest.exe".)

I created a UWP app with desktop extensions and added the startup task as mentioned here. (I set Executable="AutoStartupTest.exe".)

我注销并登录并在标题中出现错误,但不知道如何修复它,因为虽然它有道理 - 为什么它不在容器中?这应该自动发生,不是吗?该链接是关于 UWP 应用的.

I logged off and logged on and got the error in the title, and don't know how to fix it because though it makes sense - why is it not in a container? This should happen automatically, no? The link is talking about a UWP app.

编辑

请求的扩展代码段此处.

<Extensions>
  <desktop:Extension Category="windows.startupTask" Executable="AutoStartupTest.exe" EntryPoint="Windows.FullTrustApplication">
    <desktop:StartupTask TaskId="someId" Enabled="true" DisplayName="Hi user!" />
  </desktop:Extension>
</Extensions>

推荐答案

今年晚些时候的 Fall Creators 更新中将提供对 UWP 进程的 StartupTask 支持.

StartupTask support for UWP processes is coming in the Fall Creators update later this year.

您今天可以做的是将非 UWP EXE 添加到您的 UWP 包中,并将其引用为 StartupTask.确保将它放在包内的子文件夹中并相应地引用它,例如可执行文件=Win32\AutoStartTest.exe".同样在这种方法中,您需要声明runFullTrust"功能.

What you can do today is add a non-UWP EXE to your UWP package and reference that as StartupTask. Be sure to put it in a subfolder inside your package and reference it accordingly, e.g. Executable="Win32\AutoStartTest.exe". Also in this approach you will need to declare the 'runFullTrust' capability.

这篇关于错误:“此应用程序只能在应用程序容器的上下文中运行."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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