Could not load file or assembly ‘file:///…\WinSCPnet.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
You may get this error, if the WinSCP .NET assembly package was downloaded using Microsoft Internet Explorer or Edge browsers and extracted using Windows File Explorer. These applications, under certain circumstances, block libraries downloaded from Internet as potentially harmful, what prevents their loading.
To remove the block, open Properties for the WinSCPnet.dll
in Windows File Explorer. On an initial General page, click Unblock button on Security section. Alternatively, you can use Unblock-File
PowerShell cmdlet.
Advertisement
You may need to restart your IDE (if any), for the change to apply.