abp icon indicating copy to clipboard operation
abp copied to clipboard

When Using Custom Theming CSS and JS Files in 'wwwroot' w/Hyphenated Names Are Not Recognized and Produce 404s When Referenced

Open gspaninc opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

When using a custom theme, bundling, 'abp-script', 'abp-style', 'link' and 'script' methods of file inclusion do not recognize and deliver files that contain hyphens. This behavior is not limited to custom themes, and can be reproduced by downloading the source code for Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic and referencing it within an MVC Web app.

image

Reproduction Steps

Refer to CSS or JS files from within a custom theme by using bundling, 'abp-script', 'abp-style', 'link' and 'script' methods methods. Observe that those files are not being delivered and produce 404 errors.

Expected behavior

Assets files from within a custom theme that are included using bundling, 'abp-script', 'abp-style', 'link' and 'script' methods should be recognized and delivered by the theme mechanics.

Actual behavior

404 errors are produced.

Regression?

No response

Known Workarounds

  1. Rename the files by removing the hyphens.

or

  1. Copy the files to the MVC Web's wwwroot folder.

Version

8.0.0

User Interface

MVC

Database Provider

EF Core (Default)

Tiered or separate authentication server

Tiered

Operation System

Windows (Default)

Other information

Behavior seems to be specific to the Theme mechanics. Copying the files to the wwwroot folder of the MVC Web app is one of two workarounds discovered. Note that after doing so, no 404s are produced:

image

gspaninc avatar Dec 31 '23 06:12 gspaninc

hi

and can be reproduced by downloading the source code for Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic and referencing it within an MVC Web app.

Can you upload such a project on GitHub?

maliming avatar Dec 31 '23 11:12 maliming