Open Closed

Bug: Wrong icons in Volo.Abp.BlazoriseUI with Blazorise 2.0.4 (IconName enum shift) #10593


User avatar
0
juan.acedo created

ABP Version

10.2.0 (Commercial License)

Blazorise Version

2.0.4

Bug Description

After upgrading to ABP 10.2.0, several icons in Volo.Abp.BlazoriseUI components render incorrectly. Error messages show a ticket icon instead of an X mark, and confirmation dialogs show a printer instead of a question mark.

It seems that the root cause is that Volo.Abp.BlazoriseUI.dll was compiled against an older Blazorise version where the IconName enum had different integer values. Blazorise 2.0 renumbered the enum, so ABP's hardcoded integers now resolve to wrong IconName members at runtime.

Steps to Reproduce

  1. Create an ABP 10.2.0 project with Blazorise 2.0.4
  2. Trigger any IUiMessageService.Error() call (e.g., submit a form that throws a BusinessException)
  3. Observe the icon in the error modal

Expected: Red X mark icon (fa-xmark) Actual: Red ticket icon (fa-ticket-simple)

Affected Components

UiMessageAlert component in Volo.Abp.BlazoriseUI

Decompiled code shows wrong IconName mappings:

// From Volo.Abp.BlazoriseUI.dll (decompiled)
obj = MessageType switch
{
    UiMessageType.Info => IconName.Info,           // Correct
    UiMessageType.Success => IconName.Check,       // Correct
    UiMessageType.Warning => IconName.Exclamation, // Correct
    UiMessageType.Error => IconName.Ticket,        // BUG — should be IconName.Times or IconName.Xmark
    UiMessageType.Confirmation => IconName.Print,  // BUG — should be IconName.QuestionCircle
};

Note: The decompiler shows the CURRENT Blazorise 2.0.4 enum names for the integers stored in the IL. ABP originally compiled these as IconName.Times and IconName.QuestionCircle, but after Blazorise 2.0 renumbered the enum, those same integers now resolve to IconName.Ticket and IconName.Print.

Any component using IconName enum values

The enum shift also affects IconName.Redo (renders as fa-superscript instead of fa-arrow-rotate-right) and potentially many other IconName values. Any ABP component or user code that references IconName enum members and was compiled against a different Blazorise version will be affected.

Browser DevTools evidence:

  • Error icon: <i class="fas fa-ticket-simple"> (expected: fa-xmark)
  • Redo icon: <i class="fas fa-superscript"> (expected: fa-arrow-rotate-right)

Root Cause

Blazorise.IconName is a plain enum (integer-backed, no explicit values). When Blazorise 2.0 added, removed, or reordered members, all subsequent values shifted. The C# compiler bakes enum values as integer constants into the IL. Any DLL compiled against the old enum will pass wrong integers to the new FontAwesomeIconProvider.

IL evidence

// Volo.Abp.BlazoriseUI.dll IL for UiMessageType.Error icon:
// The integer stored in the IL resolves to IconName.Ticket in Blazorise 2.0.4
ldc.i4 <old_integer_for_Times>
box [Blazorise]Blazorise.IconName
// FontAwesomeIconProvider maps this integer → "fa-ticket-simple" (wrong!)

Workaround

For ABP components (UiMessageAlert), SetIconName can remap the broken entries:

// In Module.OnApplicationInitialization:
var iconProvider = context.ServiceProvider.GetRequiredService<IIconProvider>();
iconProvider.SetIconName(IconName.Ticket, "fa-xmark");          // Fix Error icon
iconProvider.SetIconName(IconName.Print, "fa-circle-question");  // Fix Confirmation icon

Warning: This globally remaps IconName.Ticket and IconName.Print, which breaks any legitimate use of those icons elsewhere.

For user code (.razor files), replace enum references with string constants:

<!-- Instead of: -->
<Icon Name="@IconName.Redo"></Icon>
<!-- Use: -->
<Icon Name="@("fa-arrow-rotate-right")"></Icon>

Environment

  • ABP: 10.2.0 Commercial
  • Blazorise: 2.0.4
  • LeptonX: 5.2.0
  • .NET: 10.0
  • OS: Windows 11
  • Browser: Chrome (tested), issue is server-side rendering
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi,

    Your analysis is correct. We confirmed this by comparing the Blazorise source code between v2.0.0 and v2.0.4.

    The IconName enum in Blazorise has no explicit integer values. In v2.0.4, two new members (Minus and Plus) were inserted into the middle of the enum (commit e3f5460ab - Gantt component #6454):

     MicrophoneSlash,
    +Minus,
     MinusCircle,
     ...
     Plug,
    +Plus,
     PlusCircle,
    

    This shifts all subsequent enum integer values by +1 or +2. Since ABP 10.2.0 was compiled against Blazorise 2.0.0, the integer constants baked into the IL now map to wrong IconName members when running with 2.0.4. That's why Times becomes Ticket, QuestionCircle becomes Print, etc.

    For now, please pin all your Blazorise packages to 2.0.0 to match what ABP 10.2.0 was compiled against:

    <PackageReference Include="Blazorise.Bootstrap5" Version="2.0.0" />
    <PackageReference Include="Blazorise.Icons.FontAwesome" Version="2.0.0" />
    <PackageReference Include="Blazorise.Components" Version="2.0.0" />
    

    We'll look into updating the Blazorise dependency version in a future release.

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    juan.acedo created

    Ok, thanks for your quick response. I will apply the fix you mentioned

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Great 👍

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.