How to capture error code and error in ExecuteCommand

Advertisement

gauragarwal
Joined:
Posts:
6
Location:
Australia

How to capture error code and error in ExecuteCommand

Hi,

I am executing a Perl script on a remote server via "ExecuteCommand". The Perl script can return error and exit code <> 0. However, when ExecuteCommand sees an error or exit code <> 0, it raises SessionRemoteException and the result of the "ExecuteCommand" remains null. How can I capture the error and return code? I am using C#. NET and .NET assembly of Winscp.

Regards,
Gaurav

Reply with quote

Advertisement

gauragarwal
Joined:
Posts:
6
Location:
Australia

Hi,

Thank you for your reply and looking into the issue. Really appreciate it. Can you also please send me winSCPnet.dll file compatible to the WinSCP.exe v5.6.2.0?

Regards,
Gaurav

Reply with quote

martin
Site Admin
martin avatar

gauragarwal wrote:

Thank you for your reply and looking into the issue. Really appreciate it. Can you also please send me winSCPnet.dll file compatible to the WinSCP.exe v5.6.2.0?
Sorry I've forgot about this. Sent now.

Reply with quote

gauragarwal

Sorry for getting back late. I was working on another area. I tried with the new files but it did not work. It still raise an exception. In Perl, the last statement called is die "error"

Reply with quote

Advertisement

gauragarwal
Joined:
Posts:
6
Location:
Australia

Here is the log file.

martin wrote:

Please set Session.DebugLogPath and attach the log file.


Here is the log file.
  • debug.log (55.64 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,440
Location:
Prague, Czechia

Re: Here is the log file.

This is a log from release version of WinSCP, not from the dev version I've sent you.

[2014-10-21 11:00:09.240Z] [0007] Executing Assembly: WinSCPnet, Version=1.2.1.4547, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf; Path: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.DLL; Location: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.dll; Product: 5.6.1.0

Reply with quote

gauragarwal
Joined:
Posts:
6
Location:
Australia

Re: Here is the log file.

martin wrote:

This is a log from release version of WinSCP, not from the dev version I've sent you.

[2014-10-21 11:00:09.240Z] [0007] Executing Assembly: WinSCPnet, Version=1.2.1.4547, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf; Path: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.DLL; Location: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.dll; Product: 5.6.1.0

My bad. Apologies. Thank you and really appreciate it. It works like a charm.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Here is the log file.

Thanks for your feedback. Official 5.6.2 beta is going to be released in few hours.

Reply with quote

Advertisement

You can post new topics in this forum