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.
Summary
Remove the Aspire dashboard workaround that manually unregisters
FluentMenuinstances fromIMenuServiceonceMicrosoft.FluentUI.AspNetCore.Componentsis updated to a version containing the upstream fix.Upstream issue: microsoft/fluentui-blazor#5032
Workaround PR: #18853
Context
FluentMenucurrently callsIMenuService.Add(this)during initialization but does not remove itself duringDisposeAsync(). In long-running dashboard circuits this causesIMenuServiceto retain disposed menus and the component/data graphs referenced by them.Aspire works around this by making
AspireMenudisposable and extendingMobileNavMenudisposal so both manually callIMenuService.Remove(FluentMenu).Cleanup
Once a Fluent UI dependency version with the fix is available:
Microsoft.FluentUI.AspNetCore.Componentsto that version.IMenuService.Removecalls and related service resolution fromAspireMenuandMobileNavMenu.Aspire.Dashboard.Components.Testssuite.