When I start a .Net 5 Razor application with
dotnet BaGet.dll
It always says 404 page not found.
However if I dotnet run it or execute the BaGet.exe file, everything are fine.
All these static files are seperated in another project
https://github.com/loic-sharma/BaGet
var path = Path.Combine(_env.ContentRootPath, "..", "BaGet.Web");
The ContentRootPath is correct that
var provider = new PhysicalFileProvider(Path.GetFullPath(path))
Is verified nornal...
How do I use correctly do "dotnet BaGet.dll"?
The final answer is that to publish application and UseStaticFiles works.