Question

I have a windows service that I built in C#. The purpose of the Windows Service is to synchronize two folders (Folder-A & Folder-B) between different servers using File System Watcher. Everything worked fine up until I moved Folder-A & Folder-B from the C drive to the D Drive. Now I can't map the folders and on the event log I get the "The local device name has a remembered connection to another network resource" error.

Also, the folders are shared and the credentials I use have full control rights to both folders.

Était-ce utile?

La solution

Hi I finally fixed my issue all I had to do on my C# code I had to force the mapping of my shared folder. Its weird because the first time I used the service for the first time I didn't for it to map. But after changing the Shared folder to a different drive that's when i had this issue.

Below is the C# code to force the mapping.

oNetDrive.Force = true;
oNetDrive.Persistent = true;

oNetDrive drive is the Shared folder. Force and Persistent are the properties.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top