"Minimal API" does not handle static files #33113
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
As announced here, ASP.NET Core introduces minimal API for creating web apps. I decided to try it out with two simple test apps.
1. Serving plain
index.html
fileHere's the sample project. Does not work. I get error:
This localhost page can't be found
.Upon investigation I found out that
WebRootPath
is the same asContentRootPath
(according to web root definition, web root path is, by default, content path pluswwwroot
):Changing
WebRootPath
toC:\minapi\wwwroot
didn't work:2. Razor Pages
This time I have included Razor Pages (sample project). This time things got interesting: the razor page was successfully generated, it appeared in browser, but neither Bootstrap file nor JavaScript file were served!


Further technical details
ASP.NET Core version: 6.0.100-preview.4.21255.9
Include the output of
dotnet --info
Output
The text was updated successfully, but these errors were encountered: