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

forester

C#: not returning after call session.open

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
martin

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?
forester

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
martin

Re: C#: not returning after call session.open

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.
forester

C#: not returning after call session.open

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. :cry:

What is my mistake?

Thanks for any help.
Forester