I am getting an Object Reference Not set to an instance of an object trying to pair mac to pc via Visual Studio

Billy Jacobs 6 Reputation points
2024-05-30T15:05:04.3066667+00:00

I have been working successfully for weeks on my .net maui application targeting ios. I normally open the application and then pair to mac from within visual studio and all is well.

However, starting yesterday evening I can no longer connect to my mac. I get an object reference error in the UI and in the logs I get the error below.

I have rebooted my mac and pc, repaired visual studio, cleared caches referenced in some articles, etc but I cannot resolve the error.

I have visual studio 17.10.1 installed on my pc and have macOS Sonoma 14.5.

I have a second PC with Visual Studio on it that I have not changed anything on in the past month that I tested on as well and I get the exact same error when trying to pair to the MAC.

DateTime=2024-05-30T14:45:28.1475204Z: 05/30/2024 14:45:28Z

Xamarin.Messaging.Integration.State.ServerStateContext Error: 0 : Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object.

at Xamarin.VisualStudio.IOS.Messaging.MonoInstallationConfigurator.<ConfigureAsync>d__13.MoveNext() in D:\a_work\1\s\src\Core\VisualStudio.IOS\Messaging\MonoInstallationConfigurator.cs:line 103

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at Xamarin.Messaging.Integration.State.ConfiguringState.<ExecuteConfiguratorsAsync>d__26.MoveNext() in D:\a_work\1\s\src\Xamarin.Messaging.Integration\State\ConfiguringState.cs:line 504: 05/30/2024 14:45:28Z

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,059 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,424 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Billy Jacobs 6 Reputation points
    2024-05-30T20:04:49.62+00:00

    Well, for no apparent reason, it started working again. I did clear the log files both on my mac and pc as suggested by someone else that fixed his problem. It did not resolve it immediately so not sure if that fixed it. Could have been a coincidence. I did clear the Xamarin caches on both machines (deleted the XMA folder) suggested by another article, also which did not fix immediately.

    Does anyone have any better information on what may have caused/solved my issue?


  2. Rob Caplan - MSFT 5,442 Reputation points Microsoft Employee
    2024-05-30T21:32:34.1+00:00

    The right place to report and follow Visual Studio bugs is in the Visual Studio Developer Community (reachable via Visual Studio's "Report a Problem" menu). See Report a problem with the Visual Studio product or installer

    This one is tracked at: https://developercommunity.visualstudio.com/t/VS-Pair-to-mac-gives-Object-reference-no/10670625 

    A service Pair to Mac depended on was down. A workaround was posted to the Dev Community yesterday to disable checking the download validation. The root cause is now resolved, and the server is back accessible. If you disabled the validation check, please reenable it so you won't run into version issues at the next update.


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.