Domanda

I have a windows service that needs to access the files (sometime modification also) from a network (shared folder). I get the file name from an XML like,

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

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

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

Thanks in advance.

È stato utile?

Soluzione

Most likely, the problem is in permissions to the shared folder. Your service runs under some user account and this account needs to have access granted to that folder. In case it's the 'Local Service' account you won't be able to access it. Just check under what account you run the service and whether it has access to that folder.

UPDATE: See this MSDN article for how to debug windows service applications.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top