Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am trying to watch a UNC Path file via FileWatcher in Windows service .Service works for local path not for UNC path. I get the below mentioned exception
Service cannot be started. System.ArgumentException: The directory name \\ServerName\Folder1\Target Folder is invalid.

This was the information i got in event viewer i have hosted the service as Network service . I can able to read the above mentioned path in FileWatcher via Console Application not via Windows Service.
Posted
Updated 19-Nov-15 23:47pm
v2
Comments
Tomas Takac 20-Nov-15 5:51am    
Are you running it under the same user account?
Dave Kreskowiak 20-Nov-15 12:47pm    
What account is your service running under? By default, it's LocalSystem which doesn't have any permissions to any network resources at all.

1 solution

It is likely a permission issue. Make sure the identity that is running the service has the proper permissions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900