protected void UploadTestTree(MediaDevice device) { this.treeListFull = treeList.Select(p => workingFolder + p).ToList(); #if NETCOREAPP string sourceFolder = Path.GetFullPath(@".\..\..\..\..\TestData\UploadTree"); #else string sourceFolder = Path.GetFullPath(@".\..\..\..\TestData\UploadTree"); #endif // create empty folders not checked in Directory.CreateDirectory(Path.Combine(sourceFolder, @"Aaa\Abb\Add")); Directory.CreateDirectory(Path.Combine(sourceFolder, @"Aaa\Acc")); Directory.CreateDirectory(Path.Combine(sourceFolder, "Bbb")); Directory.CreateDirectory(Path.Combine(sourceFolder, "Ccc")); var l = Directory.EnumerateFileSystemEntries(sourceFolder, "*", SearchOption.AllDirectories).OrderBy(s => s).ToList(); var x = Directory.GetFileSystemEntries(sourceFolder, "*", SearchOption.AllDirectories).OrderBy(s => s).ToList(); string destFolder = Path.Combine(this.workingFolder, "UploadTree"); var exists = device.DirectoryExists(destFolder); if (exists) { device.DeleteDirectory(destFolder, true); } device.UploadFolder(sourceFolder, destFolder); }