Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top