[UWP]所有后台任务都可以安全地包含在一个项目中吗? [英] [UWP] Can all background tasks safely be contained within a single project?

查看:55
本文介绍了[UWP]所有后台任务都可以安全地包含在一个项目中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在同一个VS项目中是否有任何特殊考虑捆绑所有后台任务和应用服务?

Is there any special consideration bundling all background tasks and app services within the same VS project?

推荐答案

你好TaskBasic,

Hi TaskBasic,

目前,有两种方法可以实现后台任务:进程内和进程外后台任务。无论哪个后台任务,你都需要确保它在运行时没有问题。

For now, there’re two approaches to implement background tasks: In-process and out-of-process background tasks. No matter which background task, you would need to ensure that it has no problems when it’s running.

例如,进程内后台任务,它与应用程序在同一个进程中。如果在进程后台任务中出现问题(例如,异常等),它将关闭您的应用程序进程。

For example, In-process background task, it’s in the same process with the app. If something goes wrong (e.g, exception etc.) in In-process background task, it will bring down your app process.

进程外后台任务实现为轻量级类,操作系统在一个单独的进程中运行(backgroundtaskhost.exe)。如果出现问题,它不会降低您的应用程序流程。但是,管理
跨流程通信需要更高的复杂性。

Out-of-process background tasks are implemented as lightweight classes that the OS runs in a separate process (backgroundtaskhost.exe). If something goes wrong, it will not bring down your app process. But it comes at the price of greater complexity to manage the cross-process communication.

请阅读  支持您的应用程序执行后台任务 了解更多详情。

Please read Support your app with background tasks for more details.

最诚挚的问候,

Xavier Eoro

Xavier Eoro


这篇关于[UWP]所有后台任务都可以安全地包含在一个项目中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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