InvalidOperationException on Directory.EnumerateFileSystemEntries()
See original GitHub issueHi,
If I run these commands under PowerShell:
$path = "\\Ds216j\sauvegardes\Documents" # it's a shared folder on a Synology NAS
[Alphaleonis.Win32.Filesystem.Directory]::GetFileSystemEntryInfo($path)
[Alphaleonis.Win32.Filesystem.Directory]::EnumerateFileSystemEntries($path)
I get the following output:
As you can see, the target folder is well identified as a directory by AlphaFS. However, if I try to enumerate the contents of this folder, I get an error “the target directrory is a file, not a directory”. Does anybody know why?
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Directory.EnumerateFileSystemEntries Method (System.IO)
Returns an enumerable collection of file names and directory names in a ... You can query for invalid characters by using the GetInvalidPathChars()...
Read more >UnauthorizedAccessException cannot resolve Directory. ...
// using System.Linq private static void AddFiles(string path, IList<string> files) { try { Directory.GetFiles(path) .ToList() .ForEach(s => ...
Read more >C# foreach InvalidOperationException List Has Changed
Shows a C# List throwing an InvalidOperationException after changing or modifying the List during enumeration.
Read more >DirectoryInfo - EnumerateFileSystemEntries
Returns an enumerable collection of file-system entries in a specified @this. Try it. public static string DirectoryName = "Main Directory"; public ...
Read more >What is new in C# 7.0!
private static string appConnectionString = LoadTenantConnectionString() ?? throw new InvalidOperationException("Could not load connection ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will propose a modified version of AlphaFS to the user concerned by this issue to check if the patch works. I’ll keep you informed.
Soon, I’ll start preparing.