Skip to content

MAUI App Crash on device in Release mode but runs fine in Debug mode #32357

@joehanna

Description

@joehanna

Apple platform

iOS

Framework version

net9.0-*

Affected platform version

.NET 9.0.306. Built from Rider 2025.2.3 on Mac OS and also tried VS2022 on Win 11.

Description

The app works perfectly in Debug mode but when I build the AppStore version and post it to TestFlight, the runtime behaviour is different. For instance, I have a Page that loads fine in Debug using Application.Current.MainPage.Navigation.PushAsync but fails in the AppStore version with this error:

Microsoft.Maui.Controls.ShadowTypeConverter..ctor()' is inaccessible from method

I do not consume this class so I presume it is internal to MAUI. I verified that none of the objects in the call chain were null (Application.Current.MainPage.Navigation.PushAsync)

There is no documentation or discussions anywhere about this so I have no other cases to derive troubleshooting ideas.

I am having a really tough time trying to publish my app due to the lack of better error messages and supporting documentation or forum posts. It becomes frustrating when I am fighting things I have no control over or information on. My customers are getting annoyed with the delayed release, so I would greatly appreciate any assistance you can provide.

Thank you

Mac Environment: dotnet --info

.NET SDK:
 Version:           9.0.306
 Commit:            cc9947ca66
 Workload version:  9.0.300-manifests.4f997495
 MSBuild version:   17.14.28+09c1be848

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  26.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.306/

.NET workloads installed:
 [maui]
   Installation Source: SDK 9.0.300
   Manifest Version:    9.0.111/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.111/WorkloadManifest.json
   Install Type:        FileBased

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.10
  Architecture: arm64
  Commit:       e1f19886fe

.NET SDKs installed:
  9.0.103 [/usr/local/share/dotnet/sdk]
  9.0.306 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Steps to Reproduce

Testing Debug Mode

  1. Set the build config to Debug.
  2. Build & Run with Debug
  3. The app launches. Tap the button to navigate to another page - works fine.
  4. Stop Debugging

Testing Release Mode

  1. Set the build config to Debug.
  2. Build & Run with Debug
  3. The app launches. Tap the button to navigate to another page - nothing happens - silent failure.
  4. Stop Debugging
  5. I added a try/catch and it trapped the exception: Microsoft.Maui.Controls.ShadowTypeConverter..ctor()' is inaccessible from method.

It is happening when I new-up a View to be added in the Page constructor. I am guessing is a XAML problem - but I don't know which, the XAML is over 1,100 lines. I even tried [XamlCompilation(XamlCompilationOptions.Compile)] to head off any problems at build time but no joy.

Did you find any workaround?

I cannot be sure that it is not XAML related, as XAML runtime errors are notoriously silent. The XAML page is too complex to rebuild in XAML or to refactor it out to c#.

Relevant logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions