Skip to content

Opening a page with an undefined control template crashes on iOS only when not debugging #23903

Description

@orecros

Description

I have a content page like this

<ContentPage
    ...
    ControlTemplate="{StaticResource NonExistantTemplate}">
    ...
</ContentPage>

while debugging, the control template fails to load and the page still opens fine, even on a physical device. launching without the debugger attached causes the crash when opening the page.

I don't see anything in the logs mentioning the missing control template, and there's no intellisense or build errors for it either. That's probably going to be more generally useful than fixing this bug directly.

Steps to Reproduce

Create a content page that references a nonexistant control template as described above

Debug build to an iphone simulator

Stop debugging

Relaunch the app

Open the page

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.6.24327.7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

Simulator iPhone 15 iOS 17.2

Did you find any workaround?

No response

Relevant log output

No response

Activity

  1. github-actions commented on Jul 29, 2024

    @github-actions
    Contributor

    Hi I'm an AI powered bot that finds similar issues based off the issue title.

    Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

    Closed similar issues:

    Note: You can give me feedback by thumbs upping or thumbs downing this comment.

  2. kevinxufei commented on Jul 30, 2024

    @kevinxufei

    I can repro this issue at iOS platform on the latest 17.11.0 Preview 5.0 (9.0.0-preview.6.24327.7 & 9.0.0-preview.5.24307.10 & 8.0.61). MauiApp4.zip

    56

  3. added this to the Backlog milestone on Jul 30, 2024
  4. mattleibow commented on Jul 30, 2024

    @mattleibow
    Member

    We throw here, but I wonder if we don't need to:

    Page ?? throw new InvalidOperationException("No page was set on the window.");

  5. added
    area-xamlXAML, CSS, Triggers, Behaviors
    highIt doesn't work at all, crashes or has a big impact.
    and removed
    area-xamlXAML, CSS, Triggers, Behaviors
    on Jul 31, 2024
  6. thales-man commented on Nov 28, 2025

    @thales-man

    I've faced the same problem.
    I find it hard to understand why this isn't fixed as it's a single and debatable line. What is the benefit of throwing over ignoring? If this is a dynamically loaded / bound and interchangeable element it will load late, causing this issue. And, during a 'change' will at some point be null.

    My workaround is to use a content view and embed it inside the page.

  7. added a commit that references this issue on Apr 8, 2026
  8. modified the milestones: Backlog, .NET 10 SR6 on Apr 29, 2026
  9. locked and limited conversation to collaborators on May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-windowWindowhighIt doesn't work at all, crashes or has a big impact.partner/syncfusionIssues / PR's with Syncfusion collaborationplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions