Question: InvalidProgramException in TypedBinding when running on iPad

My MAUI app runs fine on the iOS Simulator in Debug mode, but when I run it on an iPad in Release mode, I get the following cryptic error when opening a certain screen:
System.Reflection.TargetInvocationException: Arg_TargetInvocationException
 ---> System.InvalidProgramException
       at Microsoft.Maui.Controls.Internals.TypedBinding`2[[OIL.ISA.ViewModels.SettingsViewModel, OIL.ISA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget)
       at Microsoft.Maui.Controls.Internals.TypedBinding`2[[OIL.ISA.ViewModels.SettingsViewModel, OIL.ISA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Apply(Object context, BindableObject bindObj, BindableProperty targetProperty, Boolean fromBindingContextChanged)
   at Microsoft.Maui.Controls.BindableObject.ApplyBindings(Boolean skipBindingContext, Boolean fromBindingContextChanged)
       at Microsoft.Maui.Controls.BindableObject.SetInheritedBindingContext(BindableObject bindable, Object value)
   at Microsoft.Maui.Controls.Element.SetChildInheritedBindingContext(Element child, Object context)
       at Microsoft.Maui.Controls.Element.<OnBindingContextChanged>b__82_0(BindableObject child, Object bc)
   at Microsoft.Maui.Controls.BindableObjectExtensions.PropagateBindingContext[Element](BindableObject self, IEnumerable`1 children, Action`2 setChildBindingContext)
   at Microsoft.Maui.Controls.Element.OnBindingContextChanged()
       at Microsoft.Maui.Controls.VisualElement.OnBindingContextChanged()
   at Microsoft.Maui.Controls.View.OnBindingContextChanged()
   at Microsoft.Maui.Controls.BindableObject.SetInheritedBindingContext(BindableObject bindable, Object value)
       at Microsoft.Maui.Controls.Element.SetChildInheritedBindingContext(Element child, Object context)
   at Microsoft.Maui.Controls.Element.<OnBindingContextChanged>b__82_0(BindableObject child, Object bc)
       at Microsoft.Maui.Controls.BindableObjectExtensions.PropagateBindingContext[Element](BindableObject self, IEnumerable`1 children, Action`2 setChildBindingContext)
   at Microsoft.Maui.Controls.Element.OnBindingContextChanged()
   at Microsoft.Maui.Controls.VisualElement.OnBindingContextChanged()
       at Microsoft.Maui.Controls.View.OnBindingContextChanged()
   at Microsoft.Maui.Controls.BindableObject.SetInheritedBindingContext(BindableObject bindable, Object value)
   at Microsoft.Maui.Controls.Element.SetChildInheritedBindingContext(Element child, Object context)
       at Microsoft.Maui.Controls.TemplatedPage.SetChildInheritedBindingContext(Element child, Object context)
   at Microsoft.Maui.Controls.Element.<OnBindingContextChanged>b__82_0(BindableObject child, Object bc)
       at Microsoft.Maui.Controls.BindableObjectExtensions.PropagateBindingContext[Element](BindableObject self, IEnumerable`1 children, Action`2 setChildBindingContext)
   at Microsoft.Maui.Controls.Element.OnBindingContextChanged()
   at Microsoft.Maui.Controls.VisualElement.OnBindingContextChanged()
       at Microsoft.Maui.Controls.Page.OnBindingContextChanged()
   at Microsoft.Maui.Controls.ContentPage.OnBindingContextChanged()
   at Microsoft.Maui.Controls.BindableObject.BindingContextPropertyChanged(BindableObject bindable, Object oldvalue, Object newvalue)
       at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
       at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
   at Microsoft.Maui.Controls.BindableObject.SetValue(BindableProperty property, Object value, Boolean fromStyle, Boolean checkAccess)
       at Microsoft.Maui.Controls.BindableObject.SetValue(BindableProperty property, Object value)
   at Microsoft.Maui.Controls.BindableObject.set_BindingContext(Object value)
   at OIL.ISA.Views.SettingsPage..ctor()
       at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object , Object[] , Boolean )
   Exception_EndOfInnerExceptionStack
   at ObjCRuntime.Runtime.ThrowException(IntPtr )
   at UIKit.UIApplication.UIApplicationMain(Int32 , String[] , IntPtr , IntPtr )
       at UIKit.UIApplication.Main(String[] , Type , Type )
   at OIL.ISA.Platforms.iOS.Program.Main(String[] args)
    Unhandled managed exception: Arg_TargetInvocationException (System.Reflection.TargetInvocationException)
   at ObjCRuntime.Runtime.ThrowException(IntPtr )
   at UIKit.UIApplication.UIApplicationMain(Int32 , String[] , IntPtr , IntPtr )
   at UIKit.UIApplication.Main(String[] , Type , Type )
   at OIL.ISA.Platforms.iOS.Program.Main(String[] args)
 (System.InvalidProgramException)
   at Microsoft.Maui.Controls.Internals.TypedBinding`2[[OIL.ISA.ViewModels.SettingsViewModel, OIL.ISA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget)
   at Microsoft.Maui.Controls.Internals.TypedBinding`2[[OIL.ISA.ViewModels.SettingsViewModel, OIL.ISA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<…>

Searching for MAUI and InvalidProgramException does not give meaningful results. What's the cause of this exception?

As requested, here are some debugging details. The view model is like this:
public class SettingsViewModel : MainMenuPageViewModel {
    public SettingsViewModel(ViewModelServices services, IPushNotificationsService pushNotificationsService, IDatabaseUploader databaseUploader, ISecureStorage secureStorage) : base(services) {
        _pushNotificationsService = pushNotificationsService;
        _databaseUploader = databaseUploader;
        _databaseUploader.OnProgressChanged += OnDatabaseUploadProgressChanged;
        _secureStorage = secureStorage;

        Title = BaseApp.Settings;
        PushNotificationsEnabled = pushNotificationsService.DeviceToken != null;
        PushNotificationsEnabledMessage = PushNotificationsEnabled ? BaseApp.PushNotificationsEnabled : BaseApp.PushNotificationsNotEnabled;
        Logout = new Command(DoLogout);
        SendDatabase = new Command(UploadDatabase);
        ShowPushNotificationDetails = new Command(ShowNotificationDetails);

        using var context = new Context();
        UserInformation = BaseApp.LoggedInAs + " " + LocalSettings.GetUsername(context);
        UpdateSettingsInformation();
        Settings.OnRefresh += (sender, e) => UpdateSettingsInformation();
    }

    private void UpdateSettingsInformation() {
        StoreInformation = Settings.Store == null ? "" : Settings.Store.Number + " - " + Settings.Store.Name;
        OnPropertyChanged(nameof(StoreInformation));
    }

    private void OnDatabaseUploadProgressChanged(object sender, ProgressChangedEventArgs e) {
        Progress = e.ProgressPercentage / 100f;
    }

    private readonly IPushNotificationsService _pushNotificationsService;
    private readonly IDatabaseUploader _databaseUploader;
    private readonly ISecureStorage _secureStorage;

    public string UserInformation { get; }
    public string StoreInformation { get; private set; }
    public bool PushNotificationsEnabled { get; }
    public string PushNotificationsEnabledMessage { get; }
    public string AppVersion => AppInfo.VersionString;

    public ICommand Logout { get; }
    public ICommand SendDatabase { get; }
    public ICommand ShowPushNotificationDetails { get; }

    ...
}

and the page itself
<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:controls="clr-namespace:OIL.ISA.Controls"
    xmlns:vm="clr-namespace:OIL.ISA.ViewModels"
    xmlns:r="clr-namespace:OIL.ISA.Resources"
    x:DataType="vm:SettingsViewModel"
    x:Class="OIL.ISA.Views.SettingsPage"
    Title="{Binding Title}"
    Shell.NavBarIsVisible="{Binding NavBarIsVisible}">
    <ContentPage.Content>
        <AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
            <Image AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1"
                   Source="background.jpg" Aspect="AspectFill" />
            <StackLayout AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds=".5,0" WidthRequest="320"
                         BackgroundColor="#D0FFFFFF" Spacing="16" Padding="16" Margin="0,16">
                <Label Text="{Binding UserInformation}" HorizontalOptions="Center" />
                <Label Text="{Binding StoreInformation}" HorizontalOptions="Center" />
                <Button Style="{StaticResource SettingsButton}"
                        Text="{x:Static r:BaseApp.LogoutButton}"
                        Command="{Binding Logout}" />
                <Button Style="{StaticResource SettingsButton}"
                        Text="{x:Static r:BaseApp.SendDatabaseButton}"
                        Command="{Binding SendDatabase}" />
                <StackLayout Orientation="Horizontal">
                    <StackLayout.GestureRecognizers>    
                        <TapGestureRecognizer Command="{Binding ShowPushNotificationDetails}" />
                    </StackLayout.GestureRecognizers>
                    <CheckBox IsChecked="{Binding PushNotificationsEnabled}" VerticalOptions="Center" IsEnabled="False" />
                    <Label Text="{Binding PushNotificationsEnabledMessage}" VerticalOptions="Center" />
                </StackLayout>
                <Label Text="{Binding Path=AppVersion, StringFormat={x:Static r:BaseApp.Version}}"
                       HorizontalOptions="Center" />
            </StackLayout>
            <controls:BlockingActivityIndicator
                AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1"
                IsVisible="{Binding IsBusy}"
                Message="{Binding BusyMessage}"
                HasProgress="{Binding HasProgress}"
                Progress="{Binding Progress}" />
        </AbsoluteLayout>
    </ContentPage.Content>
</ContentPage>

(but as you can see, I already found the answer, I just need to document it somewhere in case someone else runs into it. Which, believe it or not, happened to myself, two months later, in another view model in the application. This is now the third hit in Google, I hope it can be useful this way)


Answer:
It turned out that my colleague used Resharper to analyze the code, and it had detected that one of the ViewModel properties:
public string AppVersion => AppInfo.VersionString;

could be changed into a static property:
public static string AppVersion => AppInfo.VersionString;

This did not cause any problems on Android or in the iOS Simulator, but was discovered only much later when testing a distribution build on an iPad. Making it an instance property again fixed the error.