Error Message:
Add-Type : Could not load file or assembly 'file:///D:\WinSCP-5.15.2-Automation\WinSCPnet.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. I placed WinSCP.dll same folder together with WinSCP.exe**
I run PowerShell v2.0.
The problem exists in the error message
The script line that causes the problem looks as following:
#Load WinSCP .NET assembly
Add-Type -Path "C:\users\Desktop\WinSCPnet.dll"
This post almost similar with this link PowerShell runtime exception - "could not load file or assembly" and I tried every method posted in the link and unable to solve it. Is there anything I missed out?