I implement UWP app service (windows runtime component) as described here. It is working fine and as far as I understand it is out-of-process background task by its nature.
What I need: to get notification in the main app when
private void OnRequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
{
}
is finished (when my background task is completed). I tried static event/event handler but when I set event handler from the main app, it is null during background task execution.
Another thing I tried is to subscribe to Completed event of background app from the main app. But BackgroundTaskRegistration.AllTasks is empty in the main app, should I additionally register uwp app service as background task? Now it is specified in the manifest with name/entry point.
You can convert your out-of-process model App Service into an in-process model, and handle task complete event in App.xaml.cs .
You can refer to this document Convert an app service to run in the same process as its host app.