Skip to content

Could not load type System.Windows.Size From Windows.Base #64

@TonyK-FmGroup

Description

@TonyK-FmGroup

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions