question

Hennry-7886 avatar image
0 Votes"
Hennry-7886 asked FernandoJunioCunhaeSousa-0285 answered

Create windows services in UWP

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.

windows-uwp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Why do you want to create windows service in UWP? Can you show more details about your expected behavior?

0 Votes 0 ·

Hi, does the following answer make sense? Do you have other questions?

0 Votes 0 ·
jadailey-MSFT avatar image
0 Votes"
jadailey-MSFT answered

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://docs.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FernandoJunioCunhaeSousa-0285 avatar image
0 Votes"
FernandoJunioCunhaeSousa-0285 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.