'MAUI iOS deploy 'There was an error while trying to automatically provision the project'
I am trying to deploy my app on an iPhone 11 for testing, but I am getting an error telling me that it cannot automatically provision the project. I am currently using MAUI but the same error happens when I try and deploy a Xamarin app to iOS (in stable VS 2022).
I have bought a developer membership for 99/year. I have installed the latest XCode on the MacOS machine My Visual Studio 2022 Preview is connected to the Mac, all my devices and IDE are connected to the developer Apple account. It detects the iPhone as a valid target but does not want to provision the project.
Is there some crucial configuration that I missed somewhere?
Solution 1:[1]
Like @Gerald Versluis said, there is a problem on the Apple side.
Until they fix this you have to use the mac as the display. In VS goto /Tools/Options/Xamarin/iOS Settings and disable "remote simulator to Windows".
The simulator will be started on the Mac, but even hotreload is working.
Solution 2:[2]
One way to accomplish this is to create a scheduled task inside the VM. That scheduled task will trigger when the machine is idle. The script the task will run is:
Stop-AzVM -Name <VM name> -ResourceGroupName <RG Name> -Force
As for the second part of starting when a user logs on, that is not possible. The VM will be off/de-allocated, there is nothing to log on to.
NOTE: the VM that has the scheduled task will also need the Azure Powershell modules installed on it and a system managed identity.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | FZelle |
| Solution 2 | Ken W MSFT |


