Pair to Mac: An error occurred while trying to connect to the Broker

Alex Mang 6 Reputation points Microsoft Regional Director
2022-08-07T02:25:42.687+00:00

I'm trying to go through the Pair to Mac procedure in order to debug a MAUI application on iOS. However, using Visual Studio 2022 Preview 6, I'm getting the most peculiar results.

Here's the error log I found at %LOCALAPPDATA%\Xamarin\Logs\17.0:

Xamarin.Messaging.Integration.State.ServerStateContext Error: 0 : An error occurred while trying to connect to the Broker...  
Xamarin.Messaging.Ssh.Exceptions.SshCommandException: Probed locations for Mono on the Server: mono64, /Library/Frameworks/Mono.framework/Versions/Current/bin/mono64, /usr/bin/mono64, /bin/mono64, /usr/local/bin/mono64, /usr/sbin/mono64, /sbin/mono64, /Users/alexmang/Library/Caches/Xamarin/XMA/Runtimes/mono/bin/mono64, mono, /Library/Frameworks/Mono.framework/Versions/Current/bin/mono, /usr/bin/mono, /bin/mono, /usr/local/bin/mono, /usr/sbin/mono, /sbin/mono, /Users/alexmang/Library/Caches/Xamarin/XMA/Runtimes/mono/bin/mono  
   at Xamarin.Messaging.Ssh.SshCommands.<GetMonoDirectoryAsync>d__36.MoveNext() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\SshCommands.cs:line 527  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at Xamarin.Messaging.Ssh.SshCommands.<CreatePListAsync>d__58.MoveNext() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\SshCommands.cs:line 807  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at Xamarin.Messaging.Ssh.SshCommands.<StartProcessWithLaunchCtlAsync>d__29.MoveNext() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\SshCommands.cs:line 311  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at Xamarin.Messaging.Ssh.MessagingRemoteCommands.<StartProcessAsync>d__3.MoveNext() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRemoteCommands.cs:line 29  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at Xamarin.Messaging.Ssh.MessagingService.<StartBrokerAsync>d__103.MoveNext() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 844  
--- End of stack trace from previous location where exception was thrown ---  
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
   at Xamarin.Messaging.Ssh.MessagingService.<ConnectMqttAsync>d__94.MoveNext() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 658: 08/07/2022 02:20:08Z  
    DateTime=2022-08-07T02:20:08.0837165Z: 08/07/2022 02:20:08Z  
Xamarin.Messaging.Integration.State.ServerStateContext Error: 0 : !An error occurred while trying to connect to the Broker...: 08/07/2022 02:20:08Z  
    DateTime=2022-08-07T02:20:08.0847171Z: 08/07/2022 02:20:08Z  
Developer technologies | .NET | .NET MAUI
Developer technologies | Visual Studio | Other
{count} vote

1 answer

Sort by: Most helpful
  1. Alex Mang 1 Reputation point
    2022-08-09T05:13:33.18+00:00

    Solution was to install the Mono framework manually.
    I feel dumb about it now, really, but expected this to be among the prerequisited of Pair to Mac.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.