FluentMenu , FluentMenuButton can not show in blazor server project #3711
Closed
tayzartun2015github
started this conversation in
General
Replies: 1 comment 4 replies
-
You need to use 3 ``` to start a code block in your posts (or use the toolbar to format your text). This is not really readable. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was used FluentMenuButton or FluentMenu object in my blazor-server project. ,When I run my app, following error mesage displayed in browser console.
System.ArgumentNullException: needs to be added to the main layout of your application/site. (Parameter 'UseMenuService')
at Microsoft.FluentUI.AspNetCore.Components.FluentMenu.OnInitialized() in /_/src/Core/Components/Menu/FluentMenu.razor.cs:line 194
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
FluentMenuProvider tag was already declared in MainLayout.razor file at the end of file. I was asked copilot , but error is still existing. So how do i use FluentMenu or FluentMenuButton, please help me ?
Program.cs
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Fast.Components.FluentUI.DesignTokens;
using Microsoft.FluentUI.AspNetCore.Components;
using Microsoft.JSInterop;
var builder = WebApplication.CreateBuilder(args);
-- in Routes.razor file
in Home.Razor file
MainLayout.razor
Beta Was this translation helpful? Give feedback.
All reactions