Note: This is primarily a Visual Studio oriented page.
You may also find Troubleshooting SSH.NET useful.
In the Debug file menu, click "Exceptions...".
If you know what the name of the exception is, and it's a .NET Framework exception do this:
If it's an SshException or or any other exception, do this:
When an exception is thrown, Visual Studio should break on the location it was thrown from.
You may also find Troubleshooting SSH.NET useful.
Going from Renci.SshNet.dll to the latest Source Code
If you have downloaded the Renci.SshNet.dll file, either from CodePlex or via NuGet, follow these steps:- Go to "Source Code" here on CodePlex
- Click "Download" (it's on the right side of the page)
- Unzip the downloaded file, it's best to put it in a sub directory of your project.
- In your project, "Add Existing Project", and find the project file "Renci.SshNet.csproj".
- Remove the old reference in your project to "Renci.SshNet".
- Add a reference to the project you just added. (In the "Project" tab of the "Add Reference" dialog, select "Renci.SshNet", click "OK").
- Run your code.
Breaking on exception - even the catched ones
This trick can be used to make Visual Studio break whenever an exception occurs of a certain type. This will work even if the exception is catched. This should work for both native, managed and CLR.In the Debug file menu, click "Exceptions...".
If you know what the name of the exception is, and it's a .NET Framework exception do this:
- Click "Find..."
- enter the name of the exception (It doesn't need the full type, just the name, like InvalidOperationException)
- Under the "Thrown" column, make sure it's checked.
- Click OK
If it's an SshException or or any other exception, do this:
- Click "Add..."
- Select "Common Language Runtime Exceptions"
- Enter the exception name (example: SshException)
- Click "OK"
When an exception is thrown, Visual Studio should break on the location it was thrown from.