-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Using dotnet 8, Visual Studio on windows 10.
Trying to process a folder with a lot a file and I get the message. This doesn't happen on every folder, only certain folders/files seem to cause a problem but it fails on a different file each time somewhere after around 680 files processed.
System.TypeLoadException: 'Could not load type 'System.Windows.Size' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.'
Visual Studio stops on this line in ShellObject.cs
~ShellObject()
{
Dispose(disposing: false);
}
Stack trace is
at Microsoft.WindowsAPICodePack.Shell.ShellObject.Dispose(Boolean disposing) in Microsoft.WindowsAPICodePack.Shell\ShellObject.cs:line 270
at Microsoft.WindowsAPICodePack.Shell.ShellObject.Finalize() in Microsoft.WindowsAPICodePack.Shell\ShellObject.cs:line 280
I've also tried not asking for the file Size, but eventually still get the exception but this time it processes over 2000 files.
I also tried commenting out all code that actually reads properties from the shell file so all I'm doing is calling ShellFile.FromFilePath(file); and I get the same outcome.