microsoft / MIEngine

The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb and lldb.
MIT License
817 stars 217 forks source link

The connection manager keeps popping up, when clicked away big error #570

Open Meai1 opened 7 years ago

Meai1 commented 7 years ago

Hi, it makes me put in the connection details every time. I tried both SSH via privatekey and password, same problem. I don't care that much about the error that happens when the connection manager dialog is clicked away but it's more visible and it indicates an obvious problem. What I need fixed is that I have to keep inputting the connection details every single time.

(this used to be better when I tried with vs2015 like half a year ago, it remembered the setting, but back then I was using the pipe options too)

Debugging works great as far as I can tell except for that.

I am running on: dotnet --version 1.0.1 (website calls it 1.1.1, I'm confused) vs2017 (installed yesterday)

miengine

options result

rajkumar42 commented 7 years ago

I couldn't reproduce at my end. Can you try removing the entry from Options->Cross Platform->Connection Manager and try again?

Meai1 commented 7 years ago

yeah the error happens anyway

Meai1 commented 7 years ago

1. The reason why the connection dialog keeps popping up is because it only finds the existing connection if I put the username in front of the ip too under "TargetMachine" like this: TargetMachine="pc@192.168.254.125. I had it like this: TargetMachine="192.168.254.125

In ConnectionManager.cs#GetInstance it uses the GetFormattedConnectionName() to produce a string for matching with the incoming TargetMachine string I cited above.

2.

I debugged through the MIDebugEngine code, you should be able to reproduce the error popup easily if you use the same options as me by omitting the username, therefore it will always try to pop up the new dialog. Then click cancel before you connect, it doesnt cancel immediately for some reason so you actually have to press cancel twice. Then the _connection will be null, AD7Port will null error out in the GetUserHomeDirectory method where it expects to have a valid connection.

<?xml version="1.0" encoding="utf-8" ?>
<SSHLaunchOptions xmlns="http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014"
                  TargetMachine="yourIpWithoutUser"
                  TargetArchitecture="x64"
                  MIMode="clrdbg"
                  ExePath="dotnet"
                  WorkingDirectory="~/clicon"
                  ExeArguments="bin/Debug/netcoreapp1.1/ConsoleApp1.dll">
</SSHLaunchOptions>
rajkumar42 commented 7 years ago

When connecting to a Linux (or Mac) machine through SSH, the convention is to specify the username@ip because the username are probably not the same.

Thanks for the feedback, the documentation for SSHLaunchOptions can be improved.