I am trying to use MS sync framework on network. But it is giving me an exception Could not find a part of the path. Can anyone please tell me how can I make the connection on network in order to sync two folders on different computers over network. I can access the folder from my explorer fine so no issue in sharing or permissions. I am in the same wifi network. I have a clue that maybe I have to enter credentials somehow.
private void button1_Click(object sender, EventArgs e)
{
FileSyncProvider sourceReplica = new FileSyncProvider(Guid.NewGuid(), @"E:\test");
FileSyncProvider destReplica = new FileSyncProvider(Guid.NewGuid(), @"\\192.168.1.9\New Folder"); //Here I am getting exception.
SyncOrchestrator agent = new SyncOrchestrator();
agent.LocalProvider = sourceReplica;
agent.RemoteProvider = destReplica;
agent.Direction = SyncDirectionOrder.UploadAndDownload;
agent.Synchronize();
}
So after spending a lot of time I finally sound a solution. Actually the problem was With credentials. So I researched online and find a solution for that.
I copied a file from an answer which is like this.
And in my main form, I did this.