Open pjninnis opened 1 month ago
@pjninnis I just discovered this issue also, and after some poking around I found that support for a lot of async stuff was added to the core SSH.Net library. I was able to get around this by getting rid of Renci.Ssh.Net.Async and using the native support in SSH.Net.
eg. var files = await sftpClient.ListDirectoryAsync("files", cancellationToken: token);
Hope that helps you!
Thanks, but I'm a bit confused.
I'm not seeing any of the Async methods in the SftpClient class in the latest SSH.Net Nuget from Renci https://www.nuget.org/packages/SSH.NET (2024.0.1) BUT I do see them in the source code on https://github.com/sshnet/SSH.NET
I'm using .NET 8
Hmm... not sure if I can provide too much guidance on that. I'm also using dotnet 8 and SSH.NET 2024.1.0.
You need
using Renci.SshNet.Sftp;
using Renci.SshNet;
This Async library isn't compatible with later versions of SSH.NET (eg latest 2024.1.0), assumably due to missing/renamed methods. eg System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerable
1 Renci.SshNet.SftpClient.EndListDirectory(System.IAsyncResult)'. at Renci.SshNet.Async.SshNetExtensions.ListDirectoryAsync(SftpClient client, String path, Action
1 listCallback, TaskFactory`1 factory, TaskCreationOptions creationOptions, TaskScheduler scheduler)