Re: Could not load WinSCP .NET assembly
Make sure you have the latest version of .NET framework and PowerShell installed.
Add-Type -Path "C:\Users\TEST\Documents\WinSCP-5.15.2-Automation\WinSCPnet.dll"
Add-Type: Unable to load the file or assembly 'file://C:\Users\TEST\Documents\WinSCP-5.15.2-Automation\WinSCPnet.dll' or one of its dependencies. This assembly has been co
built by a runtime newer than the runtime currently loaded and cannot be loaded.
Level C:\Users\TEST\Desktop\SynchroFile.ps1: 3 Character: 9
+ Add-Type -Path "C:\Users\TEST\Documents\WinSCP-5.15.2-Automation\WinSCPnet.dll"
+ CategoryInfo : NotSpecified: (:) [Add-Type], BadImageFormatException
+ FullyQualifiedErrorId: System.BadImageFormatException,Microsoft.PowerShell.commands.AddTypeCommand
Error: Cannot find the type [WinSCP.Protocol]: check that the assembly in which it is located is loaded.