[Blazor Hosted .NET 6] Server is no more returning index.html
Hi,
I've an application I'm developing for I while. Today, after some refactoring, I have that even though application starts correctly, I can e.g. perform REST request to controllers, if I navigate to the endpoint (http://localhost:5254), a 404 is returned.
In the server debug log I found this:
It seems like even though /index.html is under wwwroot, it is not published.
1 Reply
The Server Program.cs is more or less this:
I've checked git for changes, but I see nothing particularly terrible. Thus I was wondering it someone could help be reconstruct the procedure .NET performs in order to publish wwwroot folder, so I can try to understand what's wrong with it
I've fond the problem: while cleaning the solution, I removed a reference to client from server. Now I restored it and index.html is retrieved correctly!
Even so, all other files under wwwroot (css, .js...) were still not found. Turned out problem was I removed app.UseStaticFiles() to do some experiment of index.html file mapping.
Now everything is restored!