Error: "This application can only run in the context of an app container."

Error: "This application can only run in the context of an app container."

我创建了一个带有桌面扩展的 UWP 应用程序并添加了启动任务 here。 (我设置了Executable="AutoStartupTest.exe"。)

我注销并登录后出现标题错误,但不知道如何修复它,因为虽然它有道理 - 为什么它不在容器中?这应该会自动发生,不是吗? link 正在谈论 UWP 应用程序。

编辑

请求的扩展代码段

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

StartupTask 对 UWP 进程的支持将在今年晚些时候的 Fall Creators 更新中推出。

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