Which permissions are necessary for a FileSystemWatcher to monitor a network share?
I have a windows service which basically consists of a FileSystemWatcher. This service works well when monitoring local folders. The service will not, however, start when I specify a mapped drive in its app.config.
开发者_StackOverflow中文版I've changed the account type of the service to LocalSystem, LocalService, and NetworkService without any difference. Most of my testing has been done with LocalSystem.
Any suggestions?
You need an account that has access to the mapped drive. The ones you mentioned do not.
Make a domain account and run the service under it. Grant it local admin, if you like, but also give it full rights to the folder it needs to monitor.
精彩评论