I'm trying to get all the sub-directories of a Directory
.
This is the line of code that throws an exception
var projectNames = Directory.GetDirectories("Z:").ToList();
The Exception is DirectoryNotFoundException
I searched in Microsoft's Documentation and found that this Exception should only be thrown if the Directory is unmapped or does not exist, but here in this case the path exists.
I also tried to search for other reasons that can throw this exception and I found nothing.