[英]Creating a C# Windows background app service
I wonder how I can "set the background task to AppService". 我想知道如何“将后台任务设置为AppService”。
I tried to create a Windows 10 application for Cortana and I follow these steps: https://msdn.microsoft.com/en-us/library/dn974228.aspx 我尝试为Cortana创建Windows 10应用程序,请按照以下步骤操作: https : //msdn.microsoft.com/en-us/library/dn974228.aspx
I somehow can't figure out what I need to do here, because I don't have the appxmanifest file: 我不知道在这里我需要做什么,因为我没有appxmanifest文件:
In Visual Studio, open your app and declare the background task as an AppService in the app manifest. 在Visual Studio中,打开您的应用程序,然后在应用程序清单中将后台任务声明为AppService。
I know that sounds weird, but I could really not seek out. 我知道这听起来很奇怪,但是我真的找不到。 Thanks for help.
感谢帮助。
From your screenshot, it looks like you skipped a step, and only created a solution with a Runtime Component project in it, but the background task is intended to be added to an existing universal windows app. 从屏幕快照中,您似乎跳过了一个步骤,只创建了一个包含“运行时组件”项目的解决方案,但后台任务旨在添加到现有的通用Windows应用程序中。
If you're looking to create an app that also implements a background task that can run inside Cortana, you'll want to do the following: 如果您要创建一个应用程序,该应用程序还实现了可以在Cortana内部运行的后台任务,则需要执行以下操作:
I'll agree that the steps in the documentation aren't completely clear, they mention it as a prerequisite but it's not explicit enough. 我同意文档中的步骤尚不完全清楚,他们将其作为先决条件,但还不够明确。 I'll pass that along to the MSDN documentation team.
我会将其传递给MSDN文档团队。 The reason you need two separate projects (for C# and C++/CX projects anyway) is because you'll still need an existing app to install the VCD file into Cortana, and it can be launched by Cortana depending on some of the outcomes of the background task.
您需要两个单独的项目(无论如何对于C#和C ++ / CX项目)的原因是,您仍然需要一个现有的应用程序才能将VCD文件安装到Cortana中,Cortana可以根据VCD文件的某些结果来启动它。后台任务。
The documentation that the MSDN article you link is based on the sample code here: Cortana Voice Command in Microsoft's sample github repository which should help demonstrate how to connect the projects together. 您链接的MSDN文章的文档基于此处的示例代码:Microsoft的示例github存储库中的Cortana Voice Command ,该文档应有助于演示如何将项目连接在一起。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.