Reputation: 133
To evidence the issue, I build the sample trivial MAUI App generated by VS as a new solution. Before deployng to a local iOS device, VS first runs through a dialogue to initialize HotRestart, which requires a dev ID. After completing that dialogue, VS announces that it completed successfully. However, when deployed with runToCursor, the app appears to load and launch normally, but then terminates with the following:
Xamarin.PreBuilt.iOS[15710:10021051] Could not resolve assembly Microsoft.VisualStudio.DesignTools.TapContract, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null.
Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/807E989C-ABE6-4FCF-9209-87C69B0B93C9/Documents/MAUIApp.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.
Xamarin.PreBuilt.iOS[15710:10021051] Could not resolve assembly Xamarin.HotReload.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/807E989C-ABE6-4FCF-9209-87C69B0B93C9/Documents/MAUIApp.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.
VS is completely current at Windows Stable. All I can think is that there's some auth/dev step for the iPhone that causes the HotRestart dialogue to think it has completed, but permissions are incomplete in some unknown way. At a loss as to next steps. Any ideas welcomed
Upvotes: 1
Views: 448
Reputation: 133
OK, figured the answer. It appears that if you set a breakpoint / runToCursor anywhere before the first XAML page fully displays then the App will terminate in the cryptic way as above, presumably because HotReload is waiting for something ("XAML HotReload Initializing"), it times out because you are at a breakpoint, and terminates the App ("XAML HotReload Stopped").
By 'fully displays' I mean this still happens even if the breakpoint is set in an override OnAppearing() function after
base.OnAppearing(),
This makes it difficult to debug init code for the App itself. Even if the code is set as early as possible - ie in Main() before the AppDelegate is set - HotReload will still terminate after a timeout.
Upvotes: 1