In my application, I noticed a very strange thing. I have a piece of code that checks if a folder or any auxiliary folder contains .xlsfiles instead .xlsx. This is due to what I use EPPlus, which cannot process files .xls. On a computer that is running Windows 10 Home, the code below returns only files .xls, but not files .xlsx. Now I tried to run the same code on the machine Windows 10 Proas well using code .xlsx. I know that I can only get .xlsfiles using Linq, but I still would like to know why this could happen.
var filePaths = Directory.GetFiles("C:\\xmlfiles", "*.xls", SearchOption.AllDirectories).ToList();
if (filePaths.Count > 0)
{
var files = string.Join(",", filePaths);
throw new Exception($"Folder contains .xls files which EPPlus can't handle. Please convert them first. Files: {files}");
}
source
share