abpframework / abp

Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.31k stars 3.32k forks source link

Blazor UI: Blazorise 0.9.3: Unhandled Exception #7997

Closed 274188A closed 3 years ago

274188A commented 3 years ago

Version: 4.2.2 UI: Blazor

Blazor Project Refs:

<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3" />

Error

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Could not resolve type with token 0100009e from typeref (expected class 'Blazorise.ModalBackdrop' in assembly 'Blazorise, Version=0.9.3.0, Culture=neutral, PublicKeyToken=null')

274188A commented 3 years ago

still getting same error after removing the offending tags. cleaned browser cache etc.

realLiangshiwei commented 3 years ago

Did you try dotnet clean & dotnet build .blazor project

274188A commented 3 years ago

yes of course

realLiangshiwei commented 3 years ago
274188A commented 3 years ago

ok, found the problem. Only works if the preview version is used.

The 0.9.3 version fails The 0.9.3-preview6 works

Note that even running ABP new myproj -ui blazor generates 0.9.3-preview6 (why preview on brand new proj?)

So in summary my problem is fix although why does it not work on the release version (ie 0.9.3)?

stsrki commented 3 years ago

@274188A you need to follow the migration guide https://blazorise.com/news/release-notes/093/#migration-

<ModalBackdrop> is obsolete and should be removed from all razor files.

274188A commented 3 years ago

@stsrki Yes done that, see my previous comment. Problem is that preview 6 is being used for new projects using latest CLI

Follow steps below to reproduce (using CLI and Blazor UI)

274188A commented 3 years ago

ok so to Reproduce: use the CLI

ABP new testproject -ui blazor

open up the Blazor project and inspect the project xml. image

notice the version nbr for Blazorise

also note that this version is not the latest:

image

I suspect something is going amiss in the release pipeline

274188A commented 3 years ago

now if one bumps up to v0.9.3 you will get the following:

image

[All reproducible using a brand new project with the CLI]

totpero commented 3 years ago

Is the same issue reported here: https://github.com/abpframework/abp/issues/7946

274188A commented 3 years ago

@totpero - no I believe it is a different issue. CC: @stsrki

The ABP CLI v 4.2.2 generates a brand new blazor project which has the following refs:

<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3-preview6" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3-preview6" />

If you attempt to change the refs to use the so called "stable" version (9.3.1) you will see the error pop up as described above.

I simply can't describe it any simpler than this.

Obviously the builds for 9.3.1 still have refs to the Modalbackdrop and so since not allowed - the exception is thrown at run-time.

stsrki commented 3 years ago

How the CLI generates the PackageReference? I replaced all the references in .csproj files to 0.9.3 final.

ilkayilknur commented 3 years ago

@stsrki The first preview release will be using the 0.9.3 final packages. When a user creates a new project using the CLI or suite, projects are created with preview packages. I think they are using templates in the rel- branches.

274188A commented 3 years ago

i'm confused as I'm using the CLI tool with 4.2.2 - it produces refs with 0.9.3-preview6 - is it my environment somehow?

ilkayilknur commented 3 years ago

Nothing is wrong with your environment. See the template that the CLI and suite use. https://github.com/abpframework/abp/blob/rel-4.2/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj

I think the problem is Blazorise 0.9.3-final is not backward compatible with 0.9.3-preview6. @stsrki

274188A commented 3 years ago

i thought i was going mad - ok good to know!

stsrki commented 3 years ago

@ilkayilknur Yes, that is the case. ModalBackdrop was removed sometimes around preview9 I think.

274188A commented 3 years ago

ok - still, if i remove all the backdrops, upgrade to 0.9.3.1 i still have the problem. i even cleaned out .vs file, obj, bin

ilkayilknur commented 3 years ago

Yes, That's because ABP uses the ModalBackdrop internally.

274188A commented 3 years ago

right, so i should wait until that goes away ie 4.2.3?

ilkayilknur commented 3 years ago

Yes, that's the safest option, I think.

274188A commented 3 years ago

thanks for getting to the bottom of this @ilkayilknur

274188A commented 3 years ago

reopening until resolved - similar reported in #8149

ilkayilknur commented 3 years ago

I don't think that we could take extra action on this issue. It's best to wait for the new preview version. I'm closing the issue.