question

45461758 avatar image
0 Votes"
45461758 asked cheong00 edited

On platform .net5,how to start a service?

below code can only run on window.

ServiceBase[] services = new ServiceBase[] { new DoService() };
ServiceBase.Run(services);

On platform .net5,how to start a service?

dotnet-csharp
· 1
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.

Welcome to Q&A platform. You issue is more related to C#, I will add the corresponded tag and remove our network tag. Thank you for your understanding.

0 Votes 0 ·

1 Answer

cheong00 avatar image
0 Votes"
cheong00 answered cheong00 edited

Seems you can just use sc start/stop <servicename> command to start/stop it.


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.