abp icon indicating copy to clipboard operation
abp copied to clipboard

Blazor Web App fails to launch when add basic theme

Open BekAllaev opened this issue 1 year ago • 6 comments

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'

image

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: image

Actual behavior

I get this error: image

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

BekAllaev avatar Jun 25 '24 19:06 BekAllaev

hi

You can test the new rc5 template project.

maliming avatar Jun 26 '24 00:06 maliming

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?

BekAllaev avatar Jun 26 '24 08:06 BekAllaev

hi

Please share the CLI command that you used to create your project.

maliming avatar Jun 26 '24 09:06 maliming

I create Blazor Web app with this command - abp new BookStore -t app -u blazor-webapp --preview --theme basic

BekAllaev avatar Jun 26 '24 09:06 BekAllaev

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?

maliming avatar Jun 27 '24 01:06 maliming

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?

BekAllaev avatar Jun 27 '24 08:06 BekAllaev

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

BekAllaev avatar Jul 11 '24 05:07 BekAllaev