sshnet / sshnet/SSH.NET

NetConfClient.SendReceiveRpc(xml) - System.NullReferenceException

Open
#674 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

I'm learning SSH.NET and stuck at SendReceiveRpc. Every time I try to send any command - I'm getting NullReferenceException.

The code is very simple, probably I'm doing something stupid:

var ncClient = new NetConfClient(remoteHost, 22, user, password);
ncClient.Connect();

string getSoftwareVersion = @"<get-software-information/>";
XmlDocument software;

software = ncClient.SendReceiveRpc(getSoftwareVersion);

On last line I'm getting NullReferenceException. In the locals I see that ncClient.IsConnected = true. Any suggestions? RTFM? Using SSH.NET version 2016.1.0 package.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at NetConfClient.SendReceiveRpc and reproduce the NullReferenceException with the issue's connection and RPC example. Trace which value is null when processing the response, then verify the call completes without the exception and add or update coverage if the repository provides a relevant test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.