Base solution for your next web application
Open Closed

Missing CSS Files After Migrating from ASPNetZero 13.3 to 13.4 – Styling Issues #12521


User avatar
0
vital created

Hi AspNetZero Team,

We are currently in the process of migrating our application from ASP.NET Zero version 9.2 to 14.3. To date, we have successfully completed incremental upgrades and are now running AspNetZero version 13.3.

However, after merging changes from Version 13.3 to Version 13.4 (approximately 60 merge conflicts in our solution - a relatively small merge), we’ve encountered a CSS styling issue in that the application’s User Interface (UI) no longer renders correctly.

After investigating the problem, we discovered that some CSS and JS files that were present in version 13.3 are missing from the browser in version 13.4. These files appear to be part of the [wwwroot folder](http://wwwroot folder) and include style.bundle.css, datatables.css, and other layout-related resources.

We double-checked our merge commit and didn't find anything unusual or manually deleted. This leads us to believe the issue might be due to a missing configuration or a packaging change introduced between 13.3 and 13.4.

To help clarify the issue, we have attached screenshots comparing the browser developer tools and rendered UI in versions 13.3 and 13.4. You’ll see that several expected files are no longer being served in 13.4, which we believe is causing the broken layout.

Could you please advise us on what might be missing from our 13.4 setup or if there are additional steps needed to ensure these static resources are correctly bundled and served?

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

3 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @vital

    Thank you for the detailed explanation of the issue. Missing CSS and JS files after upgrading from ASP.NET Zero 13.3 to 13.4, causing UI rendering problems, is often related to one or more of the following:

    Build and Bundling Process:

    • In version 13.4, there might be changes in how static files (CSS/JS) are bundled or generated. Please make sure to run a clean frontend build (e.g., npm install and npm run create-bundles) to regenerate all assets.
    • Confirm that the output files are correctly copied into the wwwroot folder as part of your deployment process.

    Static Files Middleware and Configuration:

    • Double-check your backend setup, especially middleware related to serving static files (UseStaticFiles() in Startup.cs or Program.cs).

    File Names or Paths May Have Changed:

    • Some CSS or JS file names or folder structures might have been updated between versions.
    • Make sure you've correctly added the data table style and JavaScript files to bundles.json. They are included in bundles in multiple places.

    Compare with a Clean 13.4 Project:

    • If possible, try creating or downloading a clean ASP.NET Zero 13.4 project, build it, and compare the output structure with your project. This might help you identify missing files or differences in bundling.
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    vital created

    Hi @aguzhanagir,

    Thank you for your response. We reviewed the items above and discovered the following.

    We’ve confirmed that: • All required CSS and JS files are physically present under the wwwroot directory. • Our bundleconfig.json and gulpfile.js are correctly configured and bundles are generated. • However, when using abp-href (e.g., <link abp-href="..." />) in our layout files, the styles are not being served or resolved in the browser. • If we change abp-href to href for the same files, the browser loads them as expected and the UI renders correctly. This leads us to believe the abp-href TagHelper may not be getting picked up or functioning as expected after the 13.4 upgrade.

    In light of the above, we have the following questions:

    1. Were there any changes in v13.4 that affect abp-href usage or how static files are resolved?
    2. Are there additional registration steps or configuration needed after 13.4 to get abp-href working again?
    3. Is it safe to switch to href as a long-term workaround, or will this break multi-tenancy/resource path logic in future versions?

    Any guidance or fix would be appreciated, as we want to remain consistent with ASP.NET Zero's intended structure. Thanks again for your continued support.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @vital

    In ASP.NET Zero v13.4, there were some internal changes to how the abp-href TagHelper processes URLs, especially around resource versioning and virtual file path resolution. In most cases, abp-href still works the same, but it now depends on:

    TagHelper import in _ViewImports.cshtml Confirm that you still have:

    @using Abp.Localization
    @inherits YourProjectName.Web.Views.AbpZeroTemplateRazorPage<TModel>
    @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
    @addTagHelper *, YourProjectName.Web.Mvc
    @addTagHelper *, YourProjectName.Web.Core
    

    Without these, the abp-href tag won’t be processed and will fall back to plain HTML (hence nothing loads).

    Using abp-href is recommended in the long term, as it ensures that styles generated during the bundle and minify process are correctly optimized and versioned for better performance and cache management.

    Many npm packages have been updated with 13.4, and the bundles.json file has also been updated. You need to specifically check to see if the minify version of these files is being generated correctly. This is because the abp-href tag uses the minify version of the specified style.

    If the specified file doesn't require any changes, or if making changes doesn't provide a solution, please share your project with us so we can provide a detailed solution. Could you please email your project to [email protected]?

    Thank you

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)