locked
Error while Starting Windows File Watcher Service RRS feed

  • Question

  • I have created a windows File watcher Service which works fine on Development PC but when i am trying to install and start in other Test PC , it throws an error stating
    Windows could not start the {name of service} service on Local Computer. Error 1067: The process terminated unexpectedly.

    Please help
     
    Tuesday, April 19, 2016 12:53 PM

Answers

  • does current user also added into the local machine's admin user group? You could also use Windows's Event Viewer to see the log what went wrong.

    Thanks,

    Sabah Shariq

    • Proposed as answer by User3DX Tuesday, April 19, 2016 10:25 PM
    • Marked as answer by Kristin Xie Thursday, April 28, 2016 1:53 AM
    Tuesday, April 19, 2016 1:30 PM
  • The specific error you are getting would only occur when you try to start the service, not install it. Couple of possibilities. The obvious one is that the install of the service failed. You can verify this by looking for it in the Services app.

    The second possibility is that the service that is installed isn't the service that is trying to run. This is subtle but important. When you initially created your service the ServiceBase-derived type that was created had a ServiceName property that would have been set. This is the name of your service.  Later when you added the installer you would have added 2 - ServiceProcessInstaller and ServiceInstaller. The process installer is for the binary. The service installer is for each service you will be hosting. The service installer has a property called ServiceName as well. As documented in MSDN, this name must exactly match the name used by your ServiceBase.ServiceName property. If they do not match then the installer will install the service with the wrong name and when you try to start the service you will get the error you specified.

    When creating services I personally recommend creating a public const string containing the name of the service. Then return that as the value of the ServiceBase.ServiceName property. For the installer use that property as well. This ensures that if you rename it in one place it is renamed in both.

    Michael Taylor
    http://www.michaeltaylorp3.net

    • Proposed as answer by User3DX Tuesday, April 19, 2016 10:25 PM
    • Marked as answer by Kristin Xie Thursday, April 28, 2016 1:53 AM
    Tuesday, April 19, 2016 2:48 PM

All replies

  • Hi,

    This is a problem related permission. Make sure that the current user has access to the folder which contains installation files. Or see if current user is added in the local machine's admin user group. Hope this helps you.

    Thanks,

    Sabah Shariq

    • Proposed as answer by User3DX Tuesday, April 19, 2016 10:25 PM
    • Marked as answer by Kristin Xie Thursday, April 28, 2016 1:53 AM
    • Unmarked as answer by Kristin Xie Thursday, April 28, 2016 1:54 AM
    Tuesday, April 19, 2016 1:05 PM
  • thanks for the quick response

    I dont see any permission related issue because the current user also has the access to the folder which contains installation files


    Tuesday, April 19, 2016 1:22 PM
  • does current user also added into the local machine's admin user group? You could also use Windows's Event Viewer to see the log what went wrong.

    Thanks,

    Sabah Shariq

    • Proposed as answer by User3DX Tuesday, April 19, 2016 10:25 PM
    • Marked as answer by Kristin Xie Thursday, April 28, 2016 1:53 AM
    Tuesday, April 19, 2016 1:30 PM
  • The specific error you are getting would only occur when you try to start the service, not install it. Couple of possibilities. The obvious one is that the install of the service failed. You can verify this by looking for it in the Services app.

    The second possibility is that the service that is installed isn't the service that is trying to run. This is subtle but important. When you initially created your service the ServiceBase-derived type that was created had a ServiceName property that would have been set. This is the name of your service.  Later when you added the installer you would have added 2 - ServiceProcessInstaller and ServiceInstaller. The process installer is for the binary. The service installer is for each service you will be hosting. The service installer has a property called ServiceName as well. As documented in MSDN, this name must exactly match the name used by your ServiceBase.ServiceName property. If they do not match then the installer will install the service with the wrong name and when you try to start the service you will get the error you specified.

    When creating services I personally recommend creating a public const string containing the name of the service. Then return that as the value of the ServiceBase.ServiceName property. For the installer use that property as well. This ensures that if you rename it in one place it is renamed in both.

    Michael Taylor
    http://www.michaeltaylorp3.net

    • Proposed as answer by User3DX Tuesday, April 19, 2016 10:25 PM
    • Marked as answer by Kristin Xie Thursday, April 28, 2016 1:53 AM
    Tuesday, April 19, 2016 2:48 PM