Shocky Shocky - 1 year ago 119
C# Question

Place WinSCP.exe as project resources

I'm using WinSCPnet.dll in my project and to run correctly it needs WinSCP.exe in launch directory e.g. project_path/obj/Debug. But if I want to use my program, it needs to have this .exe file all the time in same folder otherwise the program will crash.

Is it possible to place winSCP.exe into project resources so I don't have to place it in same directory everytime I move it?

(Sorry for my clunky english, don't downvote me for that :/ If you need some additional info I'll gladly post it)

Answer Source

The winscp.exe has to exist as a real file, at the moment you call the Session.Open.

So while you can store the winscp.exe to your application resources, you have to extract it somewhere (e.g. to a temporary folder), and set the Session.ExecutablePath accordingly, before you call the Session.Open.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download