Skip to content

Blazor app with RCL and UseStaticFiles will not server blazor.web.js in .NET 10 #64381

Description

@TimPurdum

Version Used: .NET 10

Steps to Reproduce:

  1. Create a new project with the ".NET MAUI Blazor Hybrid and WebApp" template and selecting Interactive Auto render mode.
  2. In the .Web app Program.cs, replace MapStaticAssets with UseStaticFiles.
  3. In App.razor, replace the assets dictionary entry for blazor.web.js with a simple script tag: <script src="_framework/blazor.web.js"></script>.

Expected Behavior:
Assets, including the blazor bootstrap file, should be served as they were in .NET 9. As is documented in ASP.NET Core Blazor static files and Static files in ASP.NET Core, there are valid reasons to use this setup.

Actual Behavior:
Error Failed to load resource: the server responded with a status of 404 () in the browser when loading https://localhost:XXXX/_framework/blazor.web.js, and thus no interactivity (counter button).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.area-blazorIncludes: Blazor, Razor Components

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions