Search code examples
c#asp.net-corerazor

Razor application 404 page not found


When I start a .Net 5 Razor application with

dotnet BaGet.dll

It always says 404 page not found.

enter image description here

However if I dotnet run it or execute the BaGet.exe file, everything are fine.

All these static files are seperated in another project

enter image description here

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"?


Solution

  • static-web-assets

    The final answer is that to publish application and UseStaticFiles works.