Why am I getting a “Could not find a part of the path” exception?

You might also be experiencing what I am: that the directory name contains some unusual characters. In my case,

Could not find a part of the path 'C:\Web\metBoot\wild iis\DigiCert© Certificate Utility for Windows_files'.

That copyright sign is the issue.

So using concepts drawn from Obtaining the short 8.3 filename from a long filename, I convert my paths to short form first, then use that to get my list of files.

StringBuilder sf = new StringBuilder(300);
int n = GetShortPathName(sourceFolder, sf, 300);
if (0 == n)
{
   tk.write(Marshal.GetLastWin32Error().ToString());
   continue;
}

 IEnumerable<string> fileGroup = Directory.EnumerateFiles(sf.ToString(), ext);