I am currently facing a really strange problem in one of my projects.
I used Tamir Gal Sharp SSH Library in my code to upload some files to FTP. When I run the code in debug mode, everything works as it should. But when I build the solution and try it with this built-in version, I get a System.IO.IOException:
Tamir.SharpSsh.jsch.JSchException: Session.connect: System.IO.IOException: End of IO Stream Read at Tamir.SharpSsh.jsch.IO.getByte(Byte[] array, Int32 begin, Int32 length) at Tamir.SharpSsh.jsch.Session.read(Buffer buf) at Tamir.SharpSsh.jsch.User.Auth.start(Session session) at Tamir.SharpSsh.jsch.UserAuthNone.start(Session session) at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout) at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout) at Tamir.SharpSsh.jsch.SshBase.ConnectSession(Int32 tcpPort) at Tamir.SharpSsh.jsch.SshBase.Connect(Int32 tcpPort) at Tamir.SharpSsh.jsch.SshBase.Connect()
There seems to be a problem with the data stream (Hello Captain Obvious! :)), so the program does not even install to complete the Connect method. I just don't understand why everything works during debugging. DLL files are copied correctly during the build process.
The code is as follows:
sftpClient = new Sftp(this.ftpHost, this.ftpUser, this.ftpPassword); sftpClient.Connect();
All variables have the correct values, and I can connect to the SFTP server using them in a client such as Filezilla.
If anyone can give me a hint or had a similar problem, I would really appreciate every comment.
Thank you all in advance and have a nice day.
source share