.NET 8 Blazor - Stopped Accessing wwwroot Folder

364 Views Asked by At

I have been working on a project in .NET 8, using the Blazor Web App template with Server rendering. Up until now, my project has been working flawlessly. However, after launching my project today, I cannot access anything in my wwwroot folder. Nothing changed between when it worked perfectly last night and this morning.

  • The wwwroot folder is still in the same default location, directly in my project folder.
  • I can no longer display any images in my componenets; I just get the alt text instead.
  • None of my bootstrap or custom css stylesheet files can be accessed. The App.razor section has not been modified whatsoever, and it is still located in its default location under the project/Components folder. My project acts as if there is no tag to these stylesheets.
  • Other external tags in my App.razor files work just fine (such as Google Font stylesheets or FontAwesome). Only the tags for files in my wwwroot folder are not working.
  • My project is not giving me any errors. It simply just ignores items in my wwwroot folder.
  • I have tried updating visual studio, and building/rebuilding my solution.

How can I further troubleshoot this issue and restore access to items in my wwwroot folder? I have other .NET 8 Blazor projects with the exact same setup that are still functioning correctly. I am not sure where this issue came from. Thank you for any insight.

1

There are 1 best solutions below

0
On BEST ANSWER

This issue was I had a page url with only variables. For example, I had @page "/{Var1}/{Var2}" as one of the page url options. Although this worked at first, upon restarting my laptop, I began having this issue until the line was removed.