Accessing a shared folder over a network in a Windows service

I have a windows service that needs to access files (sometimes modification) from the network (shared folder). I am getting the filename from XML, for example

<add key ="FolderName" value="\\192.168.0.1\Source" />

      

I made a log file which always shows the path was not found.

Also i need to know how to debug a windows service using visual studio?

Thanks in advance.

+2


source to share


1 answer


The problem is most likely with the shared folder permissions. Your service is running under a specific user account and that account must have access to this folder. If it's a Local Service account, you won't be able to access it. Just check which account you are running the service under and if it has access to that folder.



UPDATE . See this MSDN article on how to debug Windows apps.

+4


source







All Articles