Can't Get .NET Assembly to Work After Upgrading to Windows 11
I just got a new computer (upgraded from Windows 10 to Windows 11), and I am having trouble getting my PowerShell script to work with WinSCP's .NET Assembly.
Per the documentation, I downloaded WinSCP-6.3.4-Automation.zip, extracted
My PowerShell script now gives the following error when I run it:
Any idea what's wrong?
I tried it it again, thinking perhaps I hadn't used the .NET Standard Build. It still fails, and the latest log is attached. The first line in the log says:
So that tells me I'm using the right DLL.
What's wrong? I've got thousands of users waiting for me to update our Web server, and I can't until I can get past this error.
I finally got it figured out. It was a combination of two different errors:
Per the documentation, I downloaded WinSCP-6.3.4-Automation.zip, extracted
netstandard2.0/WinSCPnet.dll
, and copied it to the WinSCP directory (C:\Program Files (x86)\WinSCP
).
My PowerShell script now gives the following error when I run it:
I've had done this procedure successfully many times before, for version upgrades, and can't see that I've changed anything.ConvertTo-SecureString: Error occurred during a cryptographic operation.
Send-Files: 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)'."
Any idea what's wrong?
I tried it it again, thinking perhaps I hadn't used the .NET Standard Build. It still fails, and the latest log is attached. The first line in the log says:
[2024-09-07 18:17:40.188] [0012] .NET Standard build
What's wrong? I've got thousands of users waiting for me to update our Web server, and I can't until I can get past this error.
I finally got it figured out. It was a combination of two different errors:
- I was using the wrong version of the .NET Assembly.
- I then tried to get a more verbose log to see if it would shed any light on. Then I was confused (again) by the hopeless inadequate documentation on the meaning of the WinSCP log levels. But going back several months to read old posts, I was finally able to make sense of things.