dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.53k stars 4.53k forks source link

icudt_EFIGS.dat is never recognized by Blazor #101992

Closed funkygato closed 1 month ago

funkygato commented 1 month ago

Is there an existing issue for this?

Describe the bug

I'm trying to serve a Blazor Standalone WebAssembly project I developed in a Blazor Server environment. When published, the Blazor WASM project works just fine, can be hosted and viewed correctly on a live server. However, when including it in a out-of-the-box template Blazor Server project, and following the steps to serve it as a static web, the file icudt_EFIGS.dat is never recognized. Initially the server will throw an integrity check exception because the SHA256 that is included automatically does not match the SHA256 that the browser is checking for (I don't know the reason), so I had to go into blazor.boot.json on the WASM project and paste the SHA256 specified by the browser. After that, the integrity check is no longer a problem, but the icudt_EFIGS.dat file is never found. I have added:

app.UseFileServer(new FileServerOptions { FileProvider = new PhysicalFileProvider( Path.Combine(builder.Environment.ContentRootPath, "BlazorEVACControl/wwwroot")), RequestPath = "/control", EnableDirectoryBrowsing = true });

to Program.cs, as well as other configurations like app.UseDefaultFiles() and builder.Services.AddDirectoryBrowser(); to try to find the missing icudt_EFIGS.dat file, which correctly shows in the directory browser, but can't be accessed through the server (it always throws 404). The loading progress gets stuck at 100% after throwing 404 for the "missing" file.

I am not sure what to do at this point; the WASM project works just fine anywhere else, but the Blazor Server is struggling to serve is a static web. Most people recommend double-checking permissions to access the icudt_EFIGS.dat file (which are fine), ensuring the specified path is correct (which it is), I have tried almost every single possible solution I could find but I have not been successful so far.

Expected Behavior

The published WASM project should be served as a static web on the request path "/control", fully loading and rendering correctly.

Steps To Reproduce

· Create a new project with the Blazor Server template. · Publish a Blazor Standalone WebAssembly project with Release configuration to be served as a static website using `dotnet publish -c Release -o release. · Copy the contents in /release to a folder in the Blazor Server project's root directory · Reference the path to that folder in the Blazor Server project's "Program.cs" via app.UseFileServer(...)

This leads to the integrity check issue first, and then the 404 issue for that same icudt_EFIGS.dat file. If necessary, I can upload my local files to a repoo (it's a pretty small project).

Exceptions (if any)

No response

.NET Version

8.0.24

Anything else?

No response

dotnet-policy-service[bot] commented 1 month ago

Tagging subscribers to this area: @thaystg See info in area-owners.md if you want to be subscribed.

funkygato commented 1 month ago

Just had to add ServeUnknownFileTypes = true to the StaticFileOptions...