fix: v3 Unhandled exception rendering in NavMenuContent of FluentMainLayout
See original GitHub issue🐛 Bug Report
If the NavManuContent of the FluentMainLayout is used in a release version, then the navigation icon is not displayed correctly, as the error message listed in the point below is delivered.
💻 Repro or Code Sample
<FluentMainLayout>
<Header>
WebApp-Name
<FluentSpacer />
<AccessControl />
</Header>
<Body>
@Body
</Body>
<NavMenuContent>
<FluentNavMenuLink Icon="@(new Icons.Regular.Size24.Home())" Text="Home" Href="/" />
<FluentNavMenuLink Icon="@(new Icons.Regular.Size24.Cloud())" Text="Counter" Href="/counter" />
</NavMenuContent>
</FluentMainLayout>
🤔 Expected Behavior
😯 Current Behavior
Error Message in app release version
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: The type Microsoft.Fast.Components.FluentUI.CoreIcons+Regular+Size24+Navigation must have a parameterless constructor.
System.ArgumentException: The type Microsoft.Fast.Components.FluentUI.CoreIcons+Regular+Size24+Navigation must have a parameterless constructor.
at Microsoft.Fast.Components.FluentUI.FluentIcon`1[[Microsoft.Fast.Components.FluentUI.CoreIcons.Regular.Size24.Navigation, Microsoft.Fast.Components.FluentUI, Version=3.0.23198.21, Culture=neutral, PublicKeyToken=null]].OnParametersSet()
at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
💁 Possible Solution
🔦 Context
Blazor WASM, .NET7.0
🌍 Your Environment
- OS & Device: Windows 11
- Browser: Edge
- .NET: 7.0
- Microsoft.Fast.Components.FluentUI: 3.0.0-RC.1
Issue Analytics
- State:
- Created a month ago
- Comments:6
Top Results From Across the Web
Issues · microsoft/fluentui-blazor
fix : v3 Unhandled exception rendering in NavMenuContent of FluentMainLayout ... fix: v3 Library with Blazor Web App .NET 8.
Read more >Unhandled exception rendering component: '<' is an ...
Hi, my app is with blazor wasm I just create a controller with razor page and I obtain the message below Microsoft.AspNetCore.Components.
Read more >Unhandled exception rendering component - Microsoft Q&A
Hi, My application in blazor wasm work very well (except some issues). I was able to run my application with IIS Express with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I triggered on the ‘only when published’ part. It might be an issue with trimming and/or the new .NET 8 Native AOT settings. @dvoituron can you perhaps take a look once you’re back?
Indeed, this seems to be an error linked to the Trimming process. A Reflector should be used to look at the DLL Icons generated in the Publish folder. This icon has probably been removed by the publication process.
I’ll have a look at it next week, when I’m back from vacation 😀