0

Has anyone come up with speed performance using WinSCP .NET?

I try the C# WinSCP example in http://winscp.net/eng/docs/library#csharp. I note that when it starts up, it takes some 30 seconds to reach the first statement (the initialization of WinSCP.SessionOptions).

Anyone knows what is going on? How to speed up?

The thing I have to do is to write a C++ program (be it C++/CLI or plain C++) to automate some SFTP transfers which may happen per minute, per X minute, per hour, or even per day. Speed is a concern for me, especially transfers happen per minute. If there is another library which can perform better, please also let me know. Thanks.

  • The same question cross-posted on WinSCP support forum, without definitive answer so far: http://winscp.net/forum/viewtopic.php?t=13651 (requires registration for access) – Martin Prikryl Mar 25 '14 at 13:16

1 Answers1

0

I figure it out! Sorry about that. It is version mismatch. The version of WinSCP.exe is different from WinSCPnet.dll (the assembly).

I use the source code of the latest version of WinSCP. I use the dotnet\WinSCPnet.csproj in the source. I add the project to the C# example. Compile the assembly and then C# example. The example runs immediately, but then I see a message saying the compiled assembly has a version mismatch between dot net assembly and WinSCP.exe.

Once I make sure both (assembly and EXE) are the same version (5.5.2), the C# example runs successfully (without any startup delay).

[EDIT] Actually the delay happens in 5.5.1!

I play around with version 5.5.1 and 5.5.2. I use version 5.5.1 EXE and dot net assembly with the C# example. When the program starts up, there is delay. I switch to version 5.5.2. When the program starts up, it runs immediately.

Hope this version information helps anyone needs to use WinSCP dot net assmebly.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • I'm glad you resolved your problem. Though it does not really make any sense. The WinSCP .NET assembly does not interact with WinSCP until call to `Session.Open`. So any delay before that cannot be caused by incompatibility between those two. – Martin Prikryl Mar 26 '14 at 07:23
  • There's only single line difference between 5.5.2 and 5.5.1 assemblies. And the line should affect COM interface only: http://winscp.net/tracker/show_bug.cgi?id=1134 So it rather looks like a local problem of yours. – Martin Prikryl Mar 27 '14 at 09:01