Skip to content

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

Closed

Description

@hthroweriii

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(); 

Activity

  1. Rob-Hague commented on Nov 13, 2023

    @Rob-Hague
    Collaborator

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

  2. added this to the 2023.0.1 milestone on Nov 16, 2023
  3. WojciechNagorski commented on Dec 29, 2023

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions