Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for compatibility with SSH.NET > 2020.0.2 #20

Open
pjninnis opened this issue Oct 30, 2024 · 3 comments
Open

Update for compatibility with SSH.NET > 2020.0.2 #20

pjninnis opened this issue Oct 30, 2024 · 3 comments

Comments

@pjninnis
Copy link

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.IEnumerable1 Renci.SshNet.SftpClient.EndListDirectory(System.IAsyncResult)'. at Renci.SshNet.Async.SshNetExtensions.ListDirectoryAsync(SftpClient client, String path, Action1 listCallback, TaskFactory`1 factory, TaskCreationOptions creationOptions, TaskScheduler scheduler)

@mikeries
Copy link

@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!

@pjninnis
Copy link
Author

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

@mikeries
Copy link

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants