Bug 37591 - Xamarin Mac Agent throws Exception when connecting to new machine
Summary: Xamarin Mac Agent throws Exception when connecting to new machine
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Enzo Heredia
URL:
Depends on:
Blocks:
 
Reported: 2016-01-11 21:12 UTC by valdetero
Modified: 2016-01-26 19:42 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Visual Studio dialog (6.79 KB, image/png)
2016-01-26 19:14 UTC, valdetero
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description valdetero 2016-01-11 21:12:40 UTC
I had a working setup between Visual Studio and my Mac. I installed a new SSD and an new 10.11.2 OS on the Mac. I migrated all of my Applications. I setup remote login and opened Xcode and Xamarin Studio and logged in. When Visual Studio (which hasn't changed at all) tries to connect to the mac via the Xamarin Mac Agent dialog, nothing happens. Viewing the logs, it is throwing this exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Xamarin.VisualStudio.IOS.Messaging.ServerSelectorViewModel.EnterServerManually() in C:\Users\builder\data\lanes\2599\1390b70a\source\XamarinVS\src\Core\VisualStudio.IOS\Messaging\ServerSelectorViewModel.cs:line 232
   at Xamarin.VisualStudio.Presentation.RelayCommand.Execute(Object parameter) in C:\Users\builder\data\lanes\2599\1390b70a\source\XamarinVS\src\Core\VisualStudio.Presentation\RelayCommand.cs:line 58
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)



What did I miss or what do I need to do get a better error of why it isn't connecting?

VS Info:
Xamarin   4.0.0.1717 (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.35 (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS   9.3.99.33 (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration


Xamarin Studio:
Version 5.10.1 (build 6)

Xamarin.ios
Version 9.4.0.0 (Business Edition)

Xcode 7.2
Comment 1 valdetero 2016-01-11 21:14:31 UTC
Visual Studio 2015 Update 1.
Comment 2 valdetero 2016-01-12 14:39:07 UTC
After a few restarts, I can't seem to reproduce the problem and it seems to connect and work just fine. I assume this could probably be closed. However maybe you want to add some error handling in the EnterServerManually() method?
Comment 3 xamarin-release-manager 2016-01-26 14:22:32 UTC
Fixed in version 99.0.0.1157 (master)

Author: Mauro Agnoletti
Commit: 0636773bd2ffccfe5b6398f54514a527a7309da5 (xamarin/XamarinVS)
Comment 4 valdetero 2016-01-26 19:11:54 UTC
Will that fix the error where the Login button becomes disabled?
Comment 5 valdetero 2016-01-26 19:14:59 UTC
Created attachment 14744 [details]
Visual Studio dialog

Login attempt fails, then the Login button becomes disabled so there is no way to retry.
Comment 6 mag@xamarin.com 2016-01-26 19:42:19 UTC
This particular fix is only for this bug and is related to the logic that resolves host names and addresses to connect to the Mac, which had a bug that was causing this issue under some circumstances.

However, many improvements has been applied related to the connection mechanism, so that issue should also get solved on an upcoming public release.