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

Invoking ISftpClient.Dispose() results in [CS0121] compile error #1239

Closed
hthroweriii opened this issue Nov 13, 2023 · 2 comments
Closed

Invoking ISftpClient.Dispose() results in [CS0121] compile error #1239

hthroweriii opened this issue Nov 13, 2023 · 2 comments
Milestone

Comments

@hthroweriii
Copy link

Version: 2023.0.0

Problem

Directly invoking ISftpClient.Dispose() results in the following error:

[CS0121] The call is ambiguous between the following methods or properties: 'Renci.SshNet.IBaseClient.Dispose()' and 'System.IDisposable.Dispose()'

The following displays sample code to reproduce the compile time error.

ISftpClient sftpClient = new SftpClient(host, port, username, password);
sftpClient.Dispose(); //This line results in the [CS0121] error

Current Workaround

ISftpClient sftpClient = new SftpClient(host, port, username, password);
((IDisposable)sftpClient).Dispose(); 
@Rob-Hague
Copy link
Collaborator

Thanks for raising. This was fixed by #1229 which will be in the next version.

@WojciechNagorski WojciechNagorski added this to the 2023.0.1 milestone Nov 16, 2023
@WojciechNagorski
Copy link
Collaborator

The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1

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

3 participants