Create windows services in UWP

asked 2020-02-27T06:55:11.617+00:00
Hennry 21 Reputation points

I know how to creat windows services in Net, but how to do it using UWP, I want the service can run it automatically and we can stop it if we want.
Thanks.

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. answered 2020-02-27T23:43:08.703+00:00
    James Dailey - MSFT 336 Reputation points

    You cannot create a traditional Windows Service using the UWP platform. However, you can create a an App Service that uses a Background Task. You can communicate between an app and your UWP App Service using a defined API surface much like a web service. I've included links below with more information.

    Create and consume an app service
    https://learn.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service

    No comments

1 additional answer

Sort by: Most helpful
  1. answered 2022-10-14T13:48:25.497+00:00

    Sorry for digging up this topic. But I need to sharing this information. :)

    We needed to create a windows service "using" uwp application for publishing at MS store, and it was possible using a desktop bridge package.

    Now it's possbile using the simplest way put it on at app manifest. But it needs some restricted capability.

    You can see how it work here: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-desktop6-service

    No comments