Blazor Web App fails to launch when add basic theme
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
I am trying to add MudBlazor to Blazor Web App and I use this tutorial - https://github.com/yellow-dragon-cloud/AbpMudBlazor
When I add basic theme to the Blazor Web App application fails to launch with following error message: System.IO.FileNotFoundException: Could not load file or assembly 'Volo.Abp.AspNetCore.Components.Web.BasicTheme, Version=8.2.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. File name: 'Volo.Abp.AspNetCore.Components.Web.BasicTheme, Version=8.2.0.0, Culture=neutral, PublicKeyToken=null'
Reproduction Steps
You can reproduce this error if you complete second step - https://github.com/yellow-dragon-cloud/AbpMudBlazor?tab=readme-ov-file#2-add-packages-to-your-solution
Expected behavior
When you complete all this steps(https://github.com/yellow-dragon-cloud/AbpMudBlazor?tab=readme-ov-file#what-is-mudblazor) your application should run and you will see something like this:
Actual behavior
I get this error:
Regression?
You can add MudBlazor on the latest stable V8.1
Known Workarounds
No response
Version
8.2.0-rc.5
User Interface
Blazor
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Windows (Default)
Other information
No response
hi
You can test the new rc5 template project.
Hello @maliming. Thanks for your response. I have update abp cli to rc5 and created new blazor web app and added basic theme but I still have this error. Maybe I have done something wrong. Could you assist please?
hi
Please share the CLI command that you used to create your project.
I create Blazor Web app with this command - abp new BookStore -t app -u blazor-webapp --preview --theme basic
hi
I'm using version 8.2.0(https://www.nuget.org/packages/Volo.Abp.Cli/8.2.0) of the CLI, and it works fine.
Can you upgrade and try again?
Hi @maliming I have updated to latest version(8.2.0) and I still have this problem.
Now I create project with this command - abp new BookStore -t app -u blazor-webapp --theme basic
I've tried to add Basic theme two ways. First one:
- Go to the directory of the MyProjectName.Blazor project and run this command -
abp add-package Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme --with-source-code --add-to-solution-file - Go to the directory of the Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme and run this command -
abp add-package Volo.Abp.AspNetCore.Components.Web.BasicTheme --with-source-code --add-to-solution-file
Second one:
- Go to the directory of the MyProjectName.Blazor.Client project and run this command -
abp add-package Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme --with-source-code --add-to-solution-file - Go to the directory of the Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme and run this command -
abp add-package Volo.Abp.AspNetCore.Components.Web.BasicTheme --with-source-code --add-to-solution-file
Maybe I am doing something wrong while adding Basic theme or my command to create blazor web app is wrong or maybe I need to clear a cache?
I have solved this problem. You need to extract basic theme separatly for server with this command(you should run this command from server application):
abp add-package Volo.Abp.AspNetCore.Components.Server.BasicTheme --with-source-code --add-to-solution-file
Then from Volo.Abp.AspNetCore.Components.Server.BasicTheme you can run this command:
add-package Volo.Abp.AspNetCore.Components.Web.BasicTheme --with-source-code --add-to-solution-file
At the end navigate to client and run this command(run this command from client application directory):
abp add-package Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme --with-source-code --add-to-solution-file
Don't forget to make references from Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme and from Volo.Abp.AspNetCore.Components.Server.BasicTheme projects to Volo.Abp.AspNetCore.Components.Web.BasicTheme project