question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InvalidOperationException on Directory.EnumerateFileSystemEntries()

See original GitHub issue

Hi,

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:

1526105805067blob

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:closed
  • Created 5 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
CyberSinhcommented, May 24, 2018

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.

0reactions
Yomodocommented, Jun 4, 2018

Soon, I’ll start preparing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found