The Wayback Machine - https://web.archive.org/web/20220118052154/https://github.com/dotnet/aspnetcore/issues/39592
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor wasm not returning static files from wwwroot on first request after publish #39592

Open
1 task done
fingers10 opened this issue Jan 18, 2022 · 0 comments
Open
1 task done

Comments

@fingers10
Copy link

@fingers10 fingers10 commented Jan 18, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have a image placed inside wwwroot\images\image.png in my blazor wasm app. After publishing, when I request the image for the first time in browser with URL https://localhost/images/image.png browser gets 404 response. Now if I press Shift + F5 the image is getting served in browser. I think blazor routing has some issues with explicit static file request handling. I'm not sure. Please can anyone assist me?

Expected Behavior

The requested static file from wwwroot\images\image.png should be served instead of 404 or without pressing Shift + F5

Steps To Reproduce

  1. Create new .net 6 blazor wasm app.
  2. Add a image file inside wwwroot\images\image.png.
  3. Publish the app.
  4. Now run the published version and request the image.png via https://localhost:port/images/image.png.
  5. You should get 404 in browser.
  6. Now press Shift + F5, image will be served.

Exceptions (if any)

No response

.NET Version

6.0.101

Anything else?

.NET SDK (reflecting any global.json):
 Version:   6.0.101
 Commit:    ef49f6213a

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

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

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

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant