Problem :
I was hit in the face by a very weird behavior of the System.IO.Directory.GetParent
method:
string path1 = @"C:foobar";
DirectoryInfo parent1 = Directory.GetParent(path1);
Console.WriteLine (parent1.FullName); // Prints C:foo, as expected
// Notice the extra backslash. It should still refer to the same location, right ?
string path2 = @"C:foobar"
Solution :