Visual Studio 2022 (.NET 8 MAUI) – iOS Simulator build fails: “MSBuild was unable to connect to the Mac …” despite successful Pair to Mac

Rufius 0 Reputation points
2025-08-22T19:26:15.35+00:00

Hello,

I am trying to debug my .NET MAUI (.NET 8) project on a simulated iPhone 16, but I always get the following error when building:

MSBuild was unable to connect to the Mac with Address='xxx.xxx.x.xx' and User='username'. This connection is separate from Visual Studio and without it the project can't build. Please try building again or report this problem if the issue persists.

Environment

  • Windows: Visual Studio 2022 17.14.13
  • Mac mini (Apple Silicon, macOS 15.6)
    • Xcode 16.4 (license accepted)
    • .NET SDKs: 8.0.413 and 9.0.304 (arm64)
    • Workloads installed: maui, ios
  • SSH and SFTP to the Mac work fine (tested from PowerShell).
  • Pair to Mac in Visual Studio shows the Mac as Connected.

What I already tried

  • Installed .NET 9 SDK (since Visual Studio requires at least 9.0.5 for the build host).
  • Cleaned all caches on Windows (%LOCALAPPDATA%\Xamarin\iOS, %TEMP%\XMA, .ssh\known_hosts) and Mac (~/Library/Caches/Xamarin/XMA, ~/Library/Logs/Xamarin.Messaging-*).
  • Checked and fixed ~/.ssh/authorized_keys (contains the vs-pair key, permissions set to 600).
  • Verified Xcode: xcode-select -p, xcodebuild -runFirstLaunch → OK.
  • Remote Login (SSH) enabled on the Mac, firewall tested disabled.
Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Linhnguyen Hanoi 0 Reputation points
    2025-08-25T08:25:58.6766667+00:00

    There is a known issue about this, you can check it here: https://developercommunity.visualstudio.com/t/After-Update-to-17148-Im-unable-to-bu/10934224.

    First, make sure you install the most recent release from https://visualstudio.microsoft.com/downloads/

    And if this problem still exists, you can try installing a previous iOS workload version to see if you can get unblocked, just as Mauro Agnoletti [MSFT] mentioned. Please run the following command in a command prompt: dotnet workload install ios --version 9.0.204

    This has been confirmed to work for other users, so please give it a try and let us know.

    0 comments No comments

  2. Omkara Varshitha Kunapalli (INFOSYS LIMITED) 385 Reputation points Microsoft External Staff
    2025-08-25T09:40:43.7866667+00:00

    Thanks for reaching out!
     

    Please follow step by step procedure to fix your issue. 

    1. Visual Studio 2022 17.14.13 requires .NET 9.0.5 or later on the Mac for build host compatibility. The customer currently has 9.0.304, which may be insufficient. --Update to .NET 9.0.5 or newer on the Mac.
    2. MSBuild uses SSH to run shell commands on the Mac. Even if pairing succeeds, the build host may not be             properly initialized. Run the below command on MAC     ( xcode-select -p     xcodebuild -runFirstLaunch      dotnet --list-sdks )
    3. Check the VS workload installation : Ensure the iOS and MAUI workloads are installed correctly on both             Windows and Mac. Reinstall workloads via Visual Studio Installer if needed
      . 4. Reset connerction and clear cache. 
    4. Ensure Remote Login (SSH) is enabled and the firewall is either disabled or allows SSH traffic. If the issue             persists, test with a fresh MAUI project to rule out project-specific issues.

     

     


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.