microsoft/2LCS

App crash when running "Show RDP Details" from context menu

skaue opened this issue · 6 comments

skaue commented

Version 0.9.1.0
From context menu over a MS hosted environment, if I select "Show RDP Details" the app crashes.

Eventlog throws the following details (I have not downloaded the source and debugged myself - yet).

Application: 2LCS.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at LCS.Program.Application_ThreadException(System.Object, System.Threading.ThreadExceptionEventArgs)
at System.Windows.Forms.Application+ThreadContext.OnThreadException(System.Exception)
at System.Windows.Forms.Control.WndProcException(System.Exception)
at System.Windows.Forms.Control+ControlNativeWindow.OnThreadException(System.Exception)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
at LCS.Program.Main()

I cannot repro, so i think LCS has not changed. Did you make sure you do have a working cookie? Did you try to logout and login? If yes, then please debug in some free time and identify this corner case. Thanks.

I'm not a developer, but tried to debug myself. It seems like the code is looking for a Local Admin user, which is not available anymore for Tier1 environments. So the export will fail if there is a 7.3 (or up) cloudhosted environment in the list.

I managed to get it working again (although i'm not sure if this is the best solution), by changing HttpClientHelper.cs line 179 to:
var localAdmin = vm.Credentials.Where(x => x.Key.Contains("Local")).ToDictionary(x => x.Key, x => x.Value);

Both RDP as RDCMan export is working again.

Thanks, app is not crashing now when exporting. Only thing left is the Tier1 subscription machine RDP popup which is showing "Not Available" for User, domein and password.

Och, I do not have access to machines for all scenarios...
So you are saying that for those machines logon value is returned in "Local" variable instead of "Local Admin"?

I think i sorted it out. 0.9.3 is there

Thanks! That fixed the issue for me. the problem with tier1 machines is that there is no "Local Admin" available, only a "Local User". so removing Admin seems to work for both. :)