Skip to content

Remove FluentMenu unregister workaround after upstream fix ships #18852

Description

@JamesNK

Summary

Remove the Aspire dashboard workaround that manually unregisters FluentMenu instances from IMenuService once Microsoft.FluentUI.AspNetCore.Components is updated to a version containing the upstream fix.

Upstream issue: microsoft/fluentui-blazor#5032
Workaround PR: #18853

Context

FluentMenu currently calls IMenuService.Add(this) during initialization but does not remove itself during DisposeAsync(). In long-running dashboard circuits this causes IMenuService to retain disposed menus and the component/data graphs referenced by them.

Aspire works around this by making AspireMenu disposable and extending MobileNavMenu disposal so both manually call IMenuService.Remove(FluentMenu).

Cleanup

Once a Fluent UI dependency version with the fix is available:

  • Update Microsoft.FluentUI.AspNetCore.Components to that version.
  • Remove the manual IMenuService.Remove calls and related service resolution from AspireMenu and MobileNavMenu.
  • Remove or update the workaround-specific component tests.
  • Verify disposed menus are still removed with the updated dependency.
  • Run the full Aspire.Dashboard.Components.Tests suite.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions