Skip to content

[Blazor] UseBlazorFrameworkFiles not working as intended #28017

@yasinkavakli

Description

@yasinkavakli

Describe the bug

When using UseBlazorFrameworkFiles, I'm getting 404 on all DLL files.

To Reproduce

Create a new Blazor WASM project with In-App authentication, ASP.NET hosted and PWA.
Open the Startup.cs in the Server project and change the line app.UseBlazorFrameworkFiles(); to app.UseBlazorFrameworkFiles("/app");. After that, open your wwwroot/index.html in the Client project and change <base href="/" /> to <base href="/app" />. After that, open your Index.razor in the client project and change @page "/" to @page "/app". Then run the app with F5 and you'll get 404s on all DLLs that Blazor wants to load.

Example repo: https://github.com/Coupz/UseBlazorFrameworkFiles

Further technical details

  • ASP.NET Core version: .NET 5
  • Include the output of dotnet --info
❯ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.100
 Commit:    5044b93829

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19042
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.100\

Host (useful for support):
  Version: 5.0.0
  Commit:  cf258a14b7

.NET SDKs installed:
  3.1.404 [C:\Program Files\dotnet\sdk]
  5.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
    Visual Studio 2019 16.8.2
    VSCode October 2020 (version 1.51)

Expected outcome:

That I have to move the index.html to a subfolder of wwwroot -> wwwroot/app/index.html and that I can put other static HTML files/pages to the default wwwroot folder, which still get served by Kestrel but without loading Blazor.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyquestion

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions