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

martin

OK, will wait.

Btw, what language is that?
key-z

Hello, Martin. Thanks for the letter. Will install it a bit later. Before it here is the code:

Try

       
        sessionOptions = New COMobject("WinSCP.SessionOptions");
        sessionOptions.HostName = "XXX";
        sessionOptions.UserName = "XXX";
        sessionOptions.Password = "XXX";
        sessionOptions.SshHostKeyFingerprint = "XXX";
       
       
        session = New COMobject("WinSCP.Session");
      //session.SessionLogPath = "D:\log.txt";
      session.DebugLogPath = "D:\log2.txt";

        // Connect
        session.Open(sessionOptions);
      session.Dispose();
      Message("ОК");
    Except
      Message(ErrorDescription());
    EndTry;


And client log(but old version):

[2014-12-09 13:21:42.998Z] [0001] Runtime: 2.0.50727.5485
[2014-12-09 13:21:42.998Z] [0001] Console encoding: Input: Cyrillic (Windows) (1251); Output: Cyrillic (Windows) (1251)
[2014-12-09 13:21:42.998Z] [0001] Working directory: C:\Program Files (x86)\XXX\common
[2014-12-09 13:21:49.388Z] [0001] Result []
[2014-12-09 13:21:49.448Z] [0001] Session.System.Reflection.IReflect.GetProperties entering
[2014-12-09 13:21:49.458Z] [0001] Result [12]
[2014-12-09 13:21:49.458Z] [0001] Session.System.Reflection.IReflect.GetProperties leaving
[2014-12-09 13:21:49.458Z] [0001] Session.System.Reflection.IReflect.GetFields entering
[2014-12-09 13:21:49.458Z] [0001] Fields [0]
[2014-12-09 13:21:49.458Z] [0001] Session.System.Reflection.IReflect.GetFields leaving
[2014-12-09 13:21:49.458Z] [0001] Session.System.Reflection.IReflect.GetMethods entering
[2014-12-09 13:21:49.458Z] [0001] Result [48]
[2014-12-09 13:21:49.458Z] [0001] Session.System.Reflection.IReflect.GetMethods leaving
[2014-12-09 13:21:49.458Z] [0001] Name [Open]
[2014-12-09 13:21:49.458Z] [0001] Target [WinSCP.Session]
[2014-12-09 13:21:49.458Z] [0001] Args [1] [null]
[2014-12-09 13:21:49.458Z] [0001] Arg [0] [WinSCP.SessionOptions] [null]
[2014-12-09 13:21:49.458Z] [0001] Culture [ru-RU]
[2014-12-09 13:21:49.458Z] [0001] Invoking
[2014-12-09 13:21:49.458Z] [0001] Session.Open entering
[2014-12-09 13:21:49.458Z] [0001] Session.SetupTempPath entering
[2014-12-09 13:21:49.458Z] [0001] Temporary folder: C:\Users\XXX\AppData\Local\Temp\
[2014-12-09 13:21:49.458Z] [0001] Temporary file [C:\Users\XXX\AppData\Local\Temp\wscp1210.033C0D9D.tmp] - Exists [False]
[2014-12-09 13:21:49.458Z] [0001] Session.SetupTempPath leaving
[2014-12-09 13:21:49.458Z] [0001] ExeSessionProcess..ctor entering
[2014-12-09 13:21:49.458Z] [0001] ExeSessionProcess.GetExecutablePath entering
[2014-12-09 13:21:49.468Z] [0001] Executable found in C:\Program Files (x86)\WINSCP\winscp.exe
[2014-12-09 13:21:49.468Z] [0001] ExeSessionProcess.GetExecutablePath leaving
[2014-12-09 13:21:49.468Z] [0001] EXE executable path resolved to C:\Program Files (x86)\WINSCP\winscp.exe
[2014-12-09 13:21:49.468Z] [0001] ExeSessionProcess.CheckVersion entering
[2014-12-09 13:21:49.608Z] [0001] Version of C:\Program Files (x86)\WINSCP\winscp.exe is 5.5.5.4605, product WinSCP version is 5.5.5.0
[2014-12-09 13:21:49.608Z] [0001] ExeSessionProcess.CheckVersion leaving
[2014-12-09 13:21:49.608Z] [0001] ExeSessionProcess..ctor leaving

Hope it will be useful. Thank you.
martin

Thanks for the log. Can you also include a log from a client mode and your code?

I'm also sending you a custom build for testing. Please try it (and include its log too).
key-z

Hello

Thank you for your answer.

Here is the new log

[2014-12-09 10:44:57.009Z] [0001] Runtime: 2.0.50727.5485
[2014-12-09 10:44:57.009Z] [0001] Console encoding: Input: Cyrillic (Windows) (1251); Output: Cyrillic (Windows) (1251)
[2014-12-09 10:44:57.009Z] [0001] Working directory: C:\Windows\system32
[2014-12-09 10:44:59.895Z] [0001] Result [] [null]
[2014-12-09 10:44:59.911Z] [0001] Session.System.Reflection.IReflect.GetProperties entering
[2014-12-09 10:44:59.911Z] [0001] Result [13]
[2014-12-09 10:44:59.911Z] [0001] Session.System.Reflection.IReflect.GetProperties leaving
[2014-12-09 10:44:59.911Z] [0001] Session.System.Reflection.IReflect.GetFields entering
[2014-12-09 10:44:59.911Z] [0001] Fields [0]
[2014-12-09 10:44:59.911Z] [0001] Session.System.Reflection.IReflect.GetFields leaving
[2014-12-09 10:44:59.911Z] [0001] Session.System.Reflection.IReflect.GetMethods entering
[2014-12-09 10:44:59.911Z] [0001] Result [52]
[2014-12-09 10:44:59.911Z] [0001] Session.System.Reflection.IReflect.GetMethods leaving
[2014-12-09 10:44:59.911Z] [0001] Name [Open]
[2014-12-09 10:44:59.911Z] [0001] BindingFlags [InvokeMethod, OptionalParamBinding]
[2014-12-09 10:44:59.911Z] [0001] Binder [System.OleAutBinder]
[2014-12-09 10:44:59.911Z] [0001] Target [WinSCP.Session]
[2014-12-09 10:44:59.911Z] [0001] Args [1] [null]
[2014-12-09 10:44:59.911Z] [0001] Arg [0] [System.__ComObject] [System.__ComObject] [System.__ComObject]
[2014-12-09 10:44:59.911Z] [0001] Culture [ru-RU]
[2014-12-09 10:44:59.911Z] [0001] Invoking unambiguous method [Void Open(WinSCP.SessionOptions)]
[2014-12-09 10:44:59.989Z] [0001] Error [System.ArgumentException: Object of type 'System.__ComObject' cannot be converted to type 'WinSCP.SessionOptions'.
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at WinSCP.Session.System.Reflection.IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)]
[2014-12-09 10:44:59.989Z] [0001] Name [Open]
[2014-12-09 10:44:59.989Z] [0001] BindingFlags [InvokeMethod, OptionalParamBinding]
[2014-12-09 10:44:59.989Z] [0001] Binder [System.OleAutBinder]
[2014-12-09 10:44:59.989Z] [0001] Target [WinSCP.Session]
[2014-12-09 10:44:59.989Z] [0001] Args [1] [null]
[2014-12-09 10:44:59.989Z] [0001] Arg [0] [System.__ComObject] [System.__ComObject] [System.__ComObject]
[2014-12-09 10:44:59.989Z] [0001] Culture [ru-RU]
[2014-12-09 10:44:59.989Z] [0001] Invoking unambiguous method [Void Open(WinSCP.SessionOptions)]
[2014-12-09 10:44:59.989Z] [0001] Error [System.ArgumentException: Object of type 'System.__ComObject' cannot be converted to type 'WinSCP.SessionOptions'.
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at WinSCP.Session.System.Reflection.IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)]


Thank you.
martin

Re: Cannot find Open method

Please attach a debug log using the latest beta version.
key-z

Cannot find Open method

Hello,

Com object is initialized, but cannot find Open method

What's may be wrong?

P.S. that happens only in a server mode(executing behalf on certain service)

Client mode is ok.

Thank you in advance.

PS: Debug log is below

2014-12-04 17:08:57.838Z] [0005] Working directory: C:\Windows\system32
[2014-12-04 17:08:59.898Z] [0005] Result []
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetProperties entering
[2014-12-04 17:08:59.913Z] [0005] Result [12]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetProperties leaving
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetFields entering
[2014-12-04 17:08:59.913Z] [0005] Fields [0]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetFields leaving
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetMethods entering
[2014-12-04 17:08:59.913Z] [0005] Result [48]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetMethods leaving
[2014-12-04 17:08:59.913Z] [0005] Name [Open]
[2014-12-04 17:08:59.913Z] [0005] Target [WinSCP.Session]
[2014-12-04 17:08:59.913Z] [0005] Args [1] [null]
[2014-12-04 17:08:59.913Z] [0005] Arg [0] [System.__ComObject] [null]
[2014-12-04 17:08:59.913Z] [0005] Culture [ru-RU]
[2014-12-04 17:08:59.913Z] [0005] Invoking
[2014-12-04 17:08:59.913Z] [0005] Error [System.MissingMethodException: Method 'WinSCP.Session.Open' not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at WinSCP.Session.System.Reflection.IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetProperties entering
[2014-12-04 17:08:59.913Z] [0005] Result [12]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetProperties leaving
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetFields entering
[2014-12-04 17:08:59.913Z] [0005] Fields [0]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetFields leaving
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetMethods entering
[2014-12-04 17:08:59.913Z] [0005] Result [48]
[2014-12-04 17:08:59.913Z] [0005] Session.System.Reflection.IReflect.GetMethods leaving