i wrote a windows service that should monitor a folder and do stuff as soon as a file is copied/moved/created inside that specific folder. My problem is that while I execute the program in a console I'm able to read a shared folder without problems (local, shared, using ip or UNC) instead if I run the same code as a service (with the same user credentials, other user credentials or network service credentials) I'm not able to see the folder. The environment is windows, the specific machine win server 2008R2 the machine is in a domain.
I tried to use this class DirectoryInfo to check the actual path, and as before exists when executed as console and not exist when executed as a service. What am I missing? Also when I execute the service with different credential I'm not able to interact with the server, Is there a way to fix this?
Same behavior on my local machine