macosvisual-studiomaui.net-9.0

.NET 9 MAUi connection from Visual Studio to iMac


On my iMac, I have installed NET9 and the workload for MAUI, latest version.

enter image description here

I created a shiny MAUI project based on .NET 9. When I try to run the application from Visual Studio to a simulator such as iPhone 15 iOS 18.1, I get this error:

MSBuild was unable to connect to the Mac with Address='192.168.1.104' and User='Enrico Rossini'. 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

enter image description here

I built the project multiple times, clean the obj and bin folders, restart all machines.


Solution

  • I faced the same issue and after investigating it turns out to be a bug in workload. Using this solution works for me, I am able to compile and run app on iOS simulator.

    Please run the following command in a command prompt: dotnet workload install ios --version 9.0.204


    1. In Visual Studio 2022 open terminal window (menu View/Terminal)
    2. Type dotnet workload install ios --version 9.0.204, press Enter and wait until older version of workload is installed (replacing the actual one?)
    3. Restart VS, pair to mac again, it should install workload on mac too (if it's not installing, try to forget this mac and connect to it again?)
    4. Press F5, should be no error.