You must Sign In to post a response.
  • Category: Windows

    Windows Service not working as expected

    Hi friends.

    I have created a windows service that will close the application if any one try to open that application .
    I have added service installers and specified the local system also.
    I have installed the windows service in command prompt as administrator, the service got installed and showing in the list of services in services.msc
    The same logic is working for the windows forms application but not working as a windows service.
    What might be the problem?
    I have written the logic in the onStart event of windows service.
  • #764057
    Hai Prashant,
    Windows service will be running always and its not like windows application which will run and do the stuff at once.
    In the windows service, you need to keep pinging the windows to get the services running on the machine. Or keep some interval, when it should check the applications running and then do the stuff like stop and start the applications.
    Hope it will be helpful to you.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • Sign In to post your comments