C
C#11mo ago
XumXum

Good morning guys, I'm having a problem with my program service worker.

Good morning guys, I'm having a problem with my program. I'm trying to create a service worker for win. When I publish and register in msc and try to start the program, win always returns that it cannot start or that the program does not start in a long time. Someone help me. I'm using .net core;
10 Replies
many things
many things11mo ago
did you use the service classes or is this just a normal executable
XumXum
XumXumOP11mo ago
GitHub
GitHub - MarcosSarges/servicework
Contribute to MarcosSarges/servicework development by creating an account on GitHub.
XumXum
XumXumOP11mo ago
@not guilty I'm using the service class, I generated the project from a template.
many things
many things11mo ago
there is no use of windows service class there 😐
XumXum
XumXumOP11mo ago
No description
No description
No description
many things
many things11mo ago
the main program must inherit from System.ServiceProcess.ServiceBase that's what is managing the switches given when executing a program like a service and there you implement OnStart
XumXum
XumXumOP11mo ago
enters my program, do I have to create the main method and inherit from this class you mentioned?
XumXum
XumXumOP11mo ago
like this?
No description
many things
many things11mo ago
it should be written in the help i believe you should call ServiceBase.Run(yourService)
XumXum
XumXumOP11mo ago
ok ok I think I understand. :PatrickChad:

Did you find this page helpful?