macossshxamarin.iosvisual-studio-2022

VS 2022 pair to mac - error starting broker


I succesfully connected my PC to my Macbook the first time trying using pair to mac in VS 2022 to simulate my work in IOS, then trying a couple of days later I can no longer get it to work. I've tried all the solutions I can find and nothing has worked.

I always get this error:

An error occurred while trying to start the Broker...

An error occurred while trying to start Broker 17.12.0.153

I looked in the logs and this is all I found:

Xamarin.Messaging.Integration.State.ServerStateContext Error: 0 : An error occurred while trying to start the Broker... Xamarin.Messaging.Ssh.Exceptions.AgentInitializationException: An error occurred while trying to start Broker 17.12.0.153 ---> System.TimeoutException: The operation has timed out. at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Reactive.Subjects.AsyncSubject`1.GetResult() at Xamarin.Messaging.Ssh.MessagingRemoteCommands.d__3.MoveNext() in D:\a_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRemoteCommands.cs:line 52 --- End of inner exception stack trace --- at Xamarin.Messaging.Ssh.MessagingRemoteCommands.d__3.MoveNext() in D:\a_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRemoteCommands.cs:line 67 --- 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.d__121.MoveNext() in D:\a_work\1\s\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 1021 --- 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.d__111.MoveNext() in D:\a_work\1\s\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 813: 12/10/2024 09:06:14Z DateTime=2024-12-10T09:06:14.9635556Z: 12/10/2024 09:06:14Z

Can add the full log if needed but couldn't see anything useful

I'm new to working with Macos so there's a chance I'm missing something obvious, any help is appreciated


Solution

  • Have a look at this report: https://developercommunity.visualstudio.com/t/Error-trying-to-pair-Visual-Studio-1712/10806194?space=62&ftype=problem&preview2=true&q=fma


    I would encourage you to try a couple of things in order to see if there’s any progress. First, install the latest VS stable version, then do the steps below:

    1 - Look for other zombie Broker processes running on your Mac. To do so, run the follwing on a terminal in your Mac (ensure to not have any active connection in VS already): ps -A | grep XMA. If you see any result, kill the processes by running kill -9 , where is the process id that the first command shown

    2 - Restart your Mac (just in case your current session is in a weird state)

    3 - Try to start the broker manually. This is just a test in your Mac that doens’t affect VS. Go to /Users//Library/Caches/Xamarin/XMA/Agents/Broker/, where is your Mac user (the same you use in Pair To Mac) and is the version of the Broker. In case you have more than one version folder, use the latest by “Date Modified”. Then open a terminal in the Mac pointing to that folder and run: dotnet Broker.dll -port=45555


    This led me to find that the broker service needed .NET 8.0 which was not installed.