.net Maui Releaseモードで起動時にクラッシュする
.net Maui でiOSアプリの開発を始めました。
現在、サンプルプログラムを動作させています。
Hot Restart を使い、windows環境でデバッグしています。
DebugモードではiOS16.5(iPhoneXR)へビルド、配置、動作まで問題なくできました。
しかしReleaseモードではビルド、配置はできるものの、
アプリ起動時に以下のエラーが発生し、クラッシュしてしまいます。
Loaded assembly: /private/var/containers/Bundle/Application/BC07B520-86DC-4F36-8D53-05205EB2359F/Maui_Delete2.app/System.Xml.XPath.dll [External] Thread started: #2 Thread started: .NET Timer #3 2025-06-02 16:02:22.223 Xamarin.PreBuilt.iOS[3165:131849] Content folder: /var/mobile/Containers/Data/Application/2EFF8FD4-55A7-4CCF-8935-B9C20A70ECC2/Documents/Maui_Delete2.content 2025-06-02 16:02:22.225 Xamarin.PreBuilt.iOS[3165:131849] App path /var/mobile/Containers/Data/Application/2EFF8FD4-55A7-4CCF-8935-B9C20A70ECC2/Documents/Maui_Delete2.content/Maui_Delete2.exe System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/2EFF8FD4-55A7-4CCF-8935-B9C20A70ECC2/Documents/Maui_Delete2.content/Maui_Delete2.exe' or one of its dependencies.'
どうすればこの例外を取り除けますか?
再現手順
①net Maui のプロジェクトを .net9.0 で立ち上げる
②プロジェクトのプロパティを開き、iOS欄 Debug項目のプルダウンを「True」に変更
③Releaseモードに変更
④iOSローカルデバイスより、iPhone実機を選んでデバッグを開始