Angelos Bousias
Angelos Bousias

Reputation: 83

WinSCP .NET assembly open stored session

How can I use the .NET assembly provided by WinSCP to open a stored session created from the WinSCP application?

Upvotes: 3

Views: 2276

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202360

You should not do this. Coupling the assembly with WinSCP application configuration can cause you lots of troubles. The assembly is deliberately isolated from WinSCP application by default.


There's nothing that you cannot configure using the SessionOptions class. Either using its properties, for basic options; or using the SessionOptions.AddRawSettings method, for advanced settings.

Easy way, is to have WinSCP generate the code for you.

enter image description here


In the past, you could abuse the Session.DefaultConfiguration and the SessionOptions.HostName to open a stored session. But the Session.DefaultConfiguration has been deprecated since WinSCP 5.8 and will be removed eventually.

Upvotes: 1

Related Questions