• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Windows service question


      I created a simple windows service. This will write a text file to a mapped drive. This code works if I run it on a windows form. But it gives a "Access denied" error when I run it from a windows service.

    Could anyone advice me what might be happening.

1 Solution
check the user account that you have specified to run the windows service. By default it will use aspnet user account to run, which wouldnt have access to mapped drive. In such case run the windows service with the user credentials that has permissions to the shared drive. Go to services panel -> navigate to your service --> right click properties and go to 'log on' tab. chose 'This account' and provide your userid/pwd which has access to the shared drive.

Hope this helps!
b3cfAuthor Commented:

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now