Session HomePath

Advertisement

martinc
Joined:
Posts:
4

Session HomePath

When I open a new session using session.Open() I can see that the value of the HomePath has been set to a particular directory that is incorrect. I am wondering where this HomePath is set and how can I change it?

Thank you for any help

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,552
Location:
Prague, Czechia

Re: Session HomePath

Answer to your question greatly depends on a protocol that you are using. The best would be, if you post a session log file (Session.SessionLogPath). And tell us what path do you get in HomePath and what path would you consider correct.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,552
Location:
Prague, Czechia

I was asking what directory would your consider correct as a home path (for your account). What is not the same as the directory you want to connect to.

So now I'm not sure what is actually your question.

Do you believe that /clientdata/CL/TST_CL is not the home directory of your account? (but your SFTP server tell otherwise) Or do you actually want to "work" in another folder than your home folder?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,552
Location:
Prague, Czechia

martinc wrote:

My question is how do set the home path for the account?

I want to work in a subfolder from the home folder.
The home path for an account needs to be set of the server.
But you do not need to change a home path to work with files in another folder.
Just use an absolute path to the other folder in all calls to WinSCP .NET assembly methods.
The assembly does not have a concept of a working directory, if that's what your question is actually about.

Reply with quote

vijay65432
Guest

HomePath = 'session.HomePath' threw an exception of type 'System.InvalidOperationException'

when i execute task in the SSIS Package getting script error :

Task Name:  Package:Pkg.Import.FTPFiles.dtsx; Method:Main
Error Description:  Error when using WinSCP to upload files: System.InvalidOperationException: Session is not opened at WinSCP.Session.CheckOpened() at WinSCP.Session.FileExists(String path) at ST_2f147f67ddac483387950b7bb5418974.ScriptMain.Main() in c:\Users\503738394\AppData\Local\Temp\4\vsta\90b12eb0e2c349f48cfeecde5050ccfb\ScriptMain.cs:line 223
How to check the homepath and change the homepath will it resolve this issues please help....

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,552
Location:
Prague, Czechia

Re: HomePath = 'session.HomePath' threw an exception of type 'System.InvalidOperationException'

vijay65432 wrote:

when i execute task in the SSIS Package getting script error :

Task Name:  Package:Pkg.Import.FTPFiles.dtsx; Method:Main
Error Description:  Error when using WinSCP to upload files: System.InvalidOperationException: Session is not opened at WinSCP.Session.CheckOpened() at WinSCP.Session.FileExists(String path) at ST_2f147f67ddac483387950b7bb5418974.ScriptMain.Main() in c:\Users\503738394\AppData\Local\Temp\4\vsta\90b12eb0e2c349f48cfeecde5050ccfb\ScriptMain.cs:line 223
How to check the homepath and change the homepath will it resolve this issues please help....
The callstack shows that you get the exception by calling Session.FileExists. So why do you think that this has anything to do with Session.HomePath? Consider starting a new thread and provide more details, including a code sample and a log file. Though the problems seems to be that you call Session.FileExists before Session.Open.

Reply with quote

Advertisement

You can post new topics in this forum