Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

aksarben

.NET Assembly Version Conflict

Thanks for the reply, Martin. I finally got this to work.

I think a key part of the documentation is somewhat ambiguous, which led to my confusion. Specifically, the sentence that reads “PowerShell: No additional installations steps are needed.” If I’m correct, there IS an additional step PowerShell users need to take. You must do one of the following:

  • Set the Session.ExecutablePath property, OR

  • Copy WinSCPnet.dll from the netstandard2.0 subfolder one level up, to the folder containing WinSCP.exe.

Am I correct? Might be worth a few minutes to clarify the documentation on this point.
aksarben

.NET Assembly Version Conflict

I suddenly began getting an version error with the .NET Assembly:
Write-Error: Exception calling "Open" with "1" argument(s): "The version of C:\Program Files (x86)\WinSCP\winscp.exe (6.1.2.0) does not match version of this assembly C:\Program Files (x86)\WinSCP\netstandard2.0\WinSCPnet.dll (6.1.1.0)."

I’m guessing it may be caused by a recent WinSCP software update.

I tried downloading & installing the (hopefully) newer version of the .NET Assembly from the WinSCP site, but I then I got a different error message:
Write-Error: Exception calling "Open" with "1" argument(s): "Method not found: 'Void System.Threading.EventWaitHandle..ctor(Boolean, System.Threading.EventResetMode, System.String, Boolean ByRef, System.Security.AccessControl.EventWaitHandleSecurity)'."

Debug log is attached.
My PSVersionTable:
PSEdition                      Core

GitCommitId                    7.3.7
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

What do I have to do to make this work?