Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using C# Windows Service project.
And I'm using Microsoft Synchronization service to sync my file to server.
I want sync file to server (to network path e.g. '\\192.168.1.2\File\').
But I found a error that 'Could not find a part of the path '\\192.168.1.2\File\''.
How can I fix that error.
Posted
Updated 14-Jan-15 17:33pm
v3

1 solution

Based on the fact that you're using a service I would guess that the service is run under different account than what you use for desktop session.

For example if you use purely local account for the service, it does not have privileges to access network resources.

So as a resolution, try running the service under a different account.
 
Share this answer
 
Comments
Swan Yi 15-Jan-15 0:13am    
Thanks for your solution.
But I can't call the network path until changing my service to Network Service. (from Local Service)
Wendelius 15-Jan-15 0:35am    
The network service may not have access to the specified network share. Instead of using built-in accounts try specifying a domain account which has privileges to connect to the share and also privileges to be run as a service.

From MSDN: "NetworkService account has minimum privileges on the local computer and acts as the computer on the network.". See NetworkService Account[^]

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