Window Service In C# (ServiceProcessInsaller) -- Error 5: Access is Denied. RRS feed

  • Question

  • Dear,

    I am using Visual Studio 2008 and .NetFramework 3.5.

    I developed one windows service application in c# using FileSystemWatcher. The main goal of this project is watch an Folder and need to write the modification status in a text file (FolderWatchLog.txt). That text file appeared on another folder.

    In ServiceInstaller I specified the StartType=Manual and in ServiceProcessInstaller I specified Account=LocalSystem property.

    The issue is, in my pc (Microsoft Windows XP Professional Version 2002 Service Pack 2), I have 2 users. 1 user has ADMIN permission and the 2nd user has LIMITED permission. I developed this applicaion in ADMIN power user and installed (installutil FolderWath.exe). I can start or stop perfectly. But if I logged in the 2nd user (LIMITED permission user), then I CAN'T start or stop the service. I got the error message Could not start the FolderWatch service on LocalComputer. Error 5: Access is Denied. So, I changed the ServiceProcessInstaller Account property. But at that time I got another error in both ADMIN & LIMITED permission users. That error message was FolderWatchLog.txt Access is Denied.

    My requirement is this FolderWatch service need to has full access permisson for all type of users. Please any one suggest an idea. This is very urgent requirement to me.

    Thanks in advance.

    • Moved by liurong luo Tuesday, September 29, 2009 3:40 AM off-topic here. (From:Visual C# General)
    Friday, September 25, 2009 4:51 AM


All replies