Error with SessionOptions

Advertisement

wademoses
Joined:
Posts:
2
Location:
Wisconsin

Error with SessionOptions

Using WinSCP 5.11.2 on Windows Server 2016

I just moved from WinSCP 5.9.3 on a Windows Server 2008 R2 which ran the .Net Assembly and COM library beautifully from Access 2010 32-bit (VBA).
Now on a Windows 2016 server with Access 2010 32-bit (VBA), I have tried WinSCP 5.9.3 and 5.11.2 and cannot get past opening the SessionOptions. WinSCP GUI works perfectly when I run it manually (I can connect to multiple FTP sites and transfer files). But using the .Net Assembly/COM files from VBA causes the error below. This appears to me to be an issue with registering the .dll file or adding the Reference to it but I cannot get it to work.

Here is the VBA code:

Dim SessionOptions As New SessionOptions
With SessionOptions <<------------------- Error happens here
.Protocol = Protocol_Sftp
.hostName = vFTPServ
.username = vUser
.password = vPass
.SshHostKeyFingerprint = "ssh-rsa 1024 3a:a8:c2:c0:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:60:be"
End With


Here is the error:

Run-time error '-2146232576 (80131700)':
Automation error

SessionOptions = <Object variable or With block variable not set>

Things I have already tried:
- Registered and Unregistered the .dll files successfully many times using the online examples:

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet32.tlb
%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet64.tlb

- Re-selected the Reference to the WinSCP Scripting Interface .Net Wrapper
- Made sure the .dll, .tlb, and WinSCP.exe files are all in the same folder.
- Rebooted the server
- I checked the log file but nothing gets logged this early in the process. (Manually running WinSCP does log connections just fine.)

Help! WinSCP is wonderful when it is working!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Error with SessionOptions

Googling for "error 80131700", it seems that it's related to broken installation of .NET framework. Try to reinstall/fix it.

Reply with quote

wademoses

I just uninstalled .Net 4.7, rebooted, reinstalled .Net 4.7, and re-registered the .DLL for 32 & 64 bit successfully. I am still getting the same error.

Does WinSCP COM need an older version of .Net? .Net 4.7 is the only version I see that is intended to run on Server 2016.

Reply with quote

Advertisement

You can post new topics in this forum