title: SSH.NET "Cannot access a disposed object"
body: <p>I have recently been fiddling with the SSH.NET library and I've been searching/troubleshooting the disposed object error when trying to execute
  a second command. Here is my code:</p>
  
  <pre><code>private void statusBtn_Click(object sender, System.EventArgs e)
  {
      Commands("status");
  }
  
  private void startBtn_Click(object sender, System.EventArgs e)
  {
      Commands("start");
  }
  
  private void Commands(string cmd)
  {
      using (sdtd_client)
      {
          sdtd_client.Connect();
          switch (cmd)
          {
              case "status":
                  var status = sdtd_client.CreateCommand("7dtd.sh status Nom");
                  string result = status.Execute();
                  outputBox.AppendText(result);
              break;
              case "start":
                  var start = sdtd_client.CreateCommand("uptime");
                  string result_start = start.Execute();
                  outputBox.AppendText(result_start);
              break;
              default:
                  outputBox.AppendText("Unrecognized Command.");
              break;
          }
          sdtd_client.Disconnect();
      }
  }
  </code></pre>
  
  <p>I realize "sdtd_client.Disconnect();" is disposing the connection, but even without using that, it still disposes.</p>
  
  <p>How can I safely connect, execute, disconnect each time I run different commands?</p>
  
  <p>Even if I opened the connection on application start and only disconnected on unload, every command executed will dispose the connection object.</p>
  
  <p>Is there something obvious I am missing?</p>