Topic "C#: not returning after call session.open"

Author Message
forester
[View user's profile]

Joined: 2014-07-29
Posts: 3
Hi,

I try to use the automation.
Dev envrionment Win 7 64bit, net 4.0, SharpDevelp.

Source code taken from https://winscp.net/eng/docs/library C# Example.

Working with version 5.5.4. Copied content of install dir to my debug-dir, added winscpnet.dll. Did the registration with "%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb". Added the reference via com-Browser and selected winscpnet.dll.

Compiler works fine. No messages.

When running, it goes up to line
"session.Open(sessionOptions);"
calls this and disappears for ever. Will say, nothing happens any more. No log at the ftp-Server side, no message at all. In the Windows TaskManager I see one instance of winscp.exe.

I repeated with older version 5.5.0, i tried by using the NuGet packages. Always the same.
When I use a non matching winscp.exe the .open statement tells me "non matching versions".

By the way, same thing for Visual Basic.

I am desperate. Crying or Very sad

What is my mistake?

Thanks for any help.
Forester
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please set Session.DebugLogPath and attach the log here. Thanks.

forester wrote:
Working with version 5.5.4. Copied content of install dir to my debug-dir, added winscpnet.dll. Did the registration with "%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb". Added the reference via com-Browser and selected winscpnet.dll.

No need for this. In C#, you are using the WinSCPnet.dll as a .NET assembly not via COM interop.
_________________
Martin Prikryl
forester
[View user's profile]

Joined: 2014-07-29
Posts: 3
Dear prikryl,

thanks for the hint with the debug-log. I activated it.

I found out the test program started as exe outside sharpdevelop works fine (see attached log).
Only by running in debug mode step by step from within sharpdevelop it hangs. Comparing both debug output files I see one early error:
Error getting counters: System.InvalidOperationException: Die Kategorie ist nicht vorhanden.

Please have a look yourself.
Thank you for your help.

Forester
winscp_dbg_stepbystepdebug.txt (4.97 KB) [Download]

Description: WinSCP-Debug output when running in SharpDevelop step by step debug mode

winscp_dbg_exe-ok.txt (31.3 KB) [Download]

Description: WinSCP-Debug output when starting the exe outside SharpDevelop

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
The "Error getting counters" is not relevant on its own, though it may have common cause.

It looks like the code is somehow aborted or stalls. I cannot explain that. Did you try to build the assembly from source code and debug it?
_________________
Martin Prikryl
forester
[View user's profile]

Joined: 2014-07-29
Posts: 3
Dear Pricryl,

thanks for you reply.

I tried some more time without successes.
Now I changed from SharpDevelop to MS Visual Studio Express and it works fine.

Forester
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License