Serving Files From wwwroot #15770
Unanswered
websitewill
asked this question in
Q&A
Replies: 2 comments
-
@ns8482e That UseStaticFiles you mentioned doesn't seem to be working for me. I've tried it in the above along with UseDefaultFiles and other things that look like they should work (based on the description). Any ideas? |
Beta Was this translation helpful? Give feedback.
0 replies
-
In your code above, add UseStaticFiles() before app.UseBlazorFrameworkFiles(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am still trying to sort out some silly Blazor hosting madness. Can someone tell me why in the world files that exist in wwwroot can't be served for a path but a files that DOES NOT EXIST can be served?
This blazor stuff creates a file called blazor.web.js and serves it from the root directory. The browser can find this file just fine.
But ALL of the other files that end us in my wwwroot folder when I publish the site? Nope - those get a 500 error (this specific error):
"Please register the EndpointMiddleware using 'IApplicationBuilder.UseEndpoints(...)' if using routing."
Here is the entirety of my Startup.cs file. Please help me make sense of this...
`
using System;
//Other usings omitted for brevity
namespace XYZ.Client.CustomerPortal
{
public class Startup
{
public IConfigurationRoot Configuration { get; set; }
}
`
What is the special order or parameter or I am missing to get these to be available?
TIA,
Will
Beta Was this translation helpful? Give feedback.
All reactions