question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

image

😯 Current Behavior

image

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:open
  • Created a month ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
vnbaaijcommented, Aug 22, 2023

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?

0reactions
dvoituroncommented, Aug 22, 2023

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 😀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found