How to use MudBlazor and FluentUI together?

121 Views Asked by At

I am developing a Blazor Web App using .NET 8.0 and Server as Interactive render mode.

As I am working on the frontend, I am using MudBlazor as my components library and I want to use FluentUI components to display data from the database (SQL Server) but when I try to install Microsoft.FluentUI.AspNetCore.Components package to my dependencies, I immediately get an error after installing saying

CS0234 The type or namespace name 'AspNetCore' does not exist in the namespace '__Blazor.Microsoft' (are you missing and assembly reference?)

I tried:

  1. Adding directives to my _Imports.razor or including directives dirrectly on the page
  2. Adding services of fluentUIcomponents on my Program.cs
  3. Uninstall Microsoft.FluentUI.AspNetCore.Components and Install again
  4. Cleaned the solution and rebuild
  5. Created a new project and installed MudBlazor package and Microsoft.FluentUI.AspNetCore.Components

and still got an error CS0234

1

There are 1 best solutions below

0
TRexF14 On

You likely have some missing/obsolete packages in your solution/project. You might try using NuGet packet manager to see what you have installed. Be careful updating them - depending on the versions of the component libraries you have installed, they might be trying to use specific versions of the packages - and if they conflict, that might break something. Review the req documents for both carefully. You might try starting two projects - one where you install fluent first, and then mudblazor; and then the second project, install mudblazor, and then fluent. Also, if you are using the current version of Mudblazor - I'm not sure it will work with NET8 - I'm currently trying it out, and having a lot of trouble with it.