I need to rename folder on network (I am using VPN).
Since this is on network I have to connect using credentials. I have all permissions to read and write in shared folder.
Same logic with connection to network is working when I want to delete, edit or save in same folder.
Same function is working for rename files.
Problem is just when I want to rename Folder !
This is function:
public async Task<bool> Rename(string oldPath, string newPath )
using (var network = new NetworkConnection(configuration.Value.Host, networkCredential))
return await Task.FromResult(true);
oldPath => \\10.174.133.199\SharedFolder\MyFolder
newPath => \\10.174.133.199\SharedFolder\RenamedFolder
The issue you are facing is that you are using
File.Move - a folder is not a
File, but instead a
Directory, as such you should use