Click here to Skip to main content
14,383,854 members
Rate this:
Please Sign up or sign in to vote.
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 20-Nov-15 0:47am
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100