FlaUI icon indicating copy to clipboard operation
FlaUI copied to clipboard

`ReflectionTypeLoadException` error in Windows PowerShell 5

Open yuusakuri opened this issue 4 years ago • 0 comments

Describe the bug I get errors when loading an assembly using Add-Type in Windows PowerShell 5. There are no errors in PowerShell 7.

This issue occurs when loading an assembly for .NETCoreApp. There are no errors when loading the assembly for .NETFramework.

Following dependencies fail to be resolved:

System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Xml.ReaderWriter, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Drawing.Primitives, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Collections, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.ComponentModel.Primitives, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Collections.NonGeneric, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Error

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException

Environment

PS C:\>Get-ComputerInfo  | Select-Object WindowsVersion
WindowsVersion
--------------
2004
PS C:\>$PSVersionTable.PSVersion.ToString()
5.1.19041.1023
PS C:\>dotnetversions.exe -b
2.0.50727.4927 Service Pack 2
3.0.30729.4926 Service Pack 2
3.5.30729.4926 Service Pack 1
4.0.0.0
4.8.04084
PS C:\>dotnet  --list-runtimes
Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

yuusakuri avatar Jul 10 '21 12:07 yuusakuri