The admin panel has no styles or scripts
Symptom: the admin panel (or the store owner or vendor panel) opens as plain, unstyled HTML; menus do not work; the browser's developer tools show 404 errors for files under /_content/.... The storefront may look fine at the same time.
The usual cause
The panels' styles and scripts are packaged as static web assets of a separate library. When you run the build output directly (for example dotnet bin/Debug/.../Grand.Web.dll), ASP.NET Core finds those files only through a development manifest, which it reads only when ASPNETCORE_ENVIRONMENT is Development. Without it, every /_content/... request returns 404.
Fix
- Development machine: set
ASPNETCORE_ENVIRONMENT=Developmentbefore starting, or run from Visual Studio /dotnet run, which set it for you. - Production: deploy the output of
dotnet publish(or the Docker image), not the build folder. Publishing copies the static assets next to the application, and the environment can stayProduction. - After fixing, reload with the cache bypassed (Ctrl+F5): the browser may have cached the 404 responses.
Other causes
- A reverse proxy or CDN that blocks or rewrites paths starting with
/_content. - A custom
Application:StaticFilesCacheControlor security headers that break loading; check the browser console. - Browser extensions that block scripts on the admin domain.
Related
Question not answered here? Ask the community on GitHub Discussions ↗