question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Blazor] UseBlazorFrameworkFiles not working as intended

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
javiercncommented, Dec 9, 2020

@Coupz I’m not 100% sure I got your scenario, but WRT to hosting blazor in a folder other than “/” it makes sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UseBlazorFrameworkFiles Extension not available
I am trying to set up an ASP.NET Core MVC project with the use of Blazor wasm. See: How to enable/use/configure WebAssembly Blazor...
Read more >
Host and deploy ASP.NET Core Blazor WebAssembly
Learn how to host and deploy Blazor WebAssembly using ASP.NET Core, Content Delivery Networks (CDN), file servers, and GitHub Pages.
Read more >
Blazor WebAssembly 3.2.0 Preview 2 release now available
A new preview update of Blazor WebAssembly is now available! ... There are a few known issues with this release that you may...
Read more >
Upgrade guide - Bolero: F# in WebAssembly
UseBlazorFrameworkFiles () .UseEndpoints(fun endpoints -> endpoints.UseHotReload() endpoints.MapBoleroRemoting() |> ignore // Add this endpoints.
Read more >
Blazor WebAssembly Asp.NET Core Hosted - ABP Community
This article shows how to host a Blazor WebAssembly project in a HttpApi.Host project and use a single unified project instead separated ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found