Skip to content

Unclear information in 'Static files in non-Development environments' + missing Razor static assets description (WithStaticAssets) #37197

@dcarapic

Description

@dcarapic

Description

I do not understand the information in 'Static files in non-Development environments'.
It starts with 'When running an app locally ...' ... what does this mean? This is a web app, it's always run locally somewhere, do you mean when using launchProfiles or with debugger? What about dotnet watch or dotnet run ... will it correctly serve the static files?
I did not know that there is a difference in serving static files based on environment (except the caching header stuff in Development .. that part is clear).
Please elaborate more.

In addition to this the latest Razor pages template adds:
app.MapRazorPages.WithStaticAssets()
What does this do, there seems to be no documentation for it?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-10.0#static-files-in-non-development-environments

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/static-files.md

Document ID

3fec6e08-fc99-7a5c-796f-3f2347cad891

Platform Id

5c42c2c8-be1b-60de-8cde-f9b8d8c24f5f

Article author

@wadepickett

Metadata

  • ID: d47f38e2-bc36-cfb8-b0cc-17a534689f8b
  • PlatformId: 5c42c2c8-be1b-60de-8cde-f9b8d8c24f5f
  • Service: aspnet-core
  • Sub-service: fundamentals

Related Issues

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions