-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is your feature request related to a problem? Please describe.
This request is related to a discoverability issue for UseStaticFiles extension. If do not start from a default template and add UseStaticFiles(), the inline xmldoc do not describe the default local physical path it will try to fetch the static files from.
- Running
dotnet rundoes not log the issue in the console that no path/wwwrootexist in the project and thatUseStaticFileswill do nothing. - Creating a static file at the root and trying to match the url and the physical path only returns a 404 without any more help.
Describe the solution you'd like
Default values like /wwwroot for static files should be document in the xmldoc of the API at the point of calling as to help people avoid having to switch context between their code and the docs.
Additionally, calling the extension UseStaticFiles while the default physical path /wwwroot doesn't exist should create an warning message in the logs to warn the developer of a misconfiguration. If implemented, this message should only be shown once as to avoid polluting the logs.
Additional context
My context here is for new adopter of .NET that are simply trying to create a simple API. It should be easy for them to create code without relying on the docs unless they are stuck.
