Mono's System.IO.Directory.EnumerateDirectories doesn't list all directories in the specified (relative) path if the CWD changes during enumeration.
My guess is that the .NET version of System.IO.Directory.EnumerateDirectories() keeps a handle to the current working directory or maybe resolves the full path when called and Mono's version fails to do so, which makes it unable to keep enumerating directories if the CWD changes during enumeration.
I encountered this bug with the following code under Linux running Mono 2.10.:
foreach( string strProjectDirectory in Directory.EnumerateDirectories( "Projects" ) )
// This method call changes the current working directory at some point
DoSomethingWithProjectFolder( strProjectDirectory );
// Other project folders never get enumerated
I cannot reproduce the issue, my simple tests works
public static void Main ()
foreach (var d in Directory.EnumerateDirectories ("/tmp/1", "*", SearchOption.AllDirectories))