Skip to content

Clean up static files docs for .NET 9 #34002

@danroth27

Description

@danroth27

Edit by @Rick-Anderson to change bullets to check boxes

Description

I see that the Static files in ASP.NET Core doc has been updated for the new optimized static web assets support in .NET 9, but I think we need to do a bit more cleanup for the upcoming .NET 9 release.

Some feedback on the doc as it stands:

  • The doc says “MapStaticAssets is a middleware”, but I believe that’s incorrect. MapStaticAssets plugs into endpoint routing, right? It’s the older UseStaticFiles that adds a middleware.
  • The Static files doc currently links back to the What’s new doc for the comparison of MapStaticAssets vs UseStaticFiles, but I think we actually want the link to go the other way. The What’s new docs can link to specific articles for more details, but specific articles really shouldn’t link to What’s new. EDIT search for MapStaticAssets provides the following benefits not found with UseStaticFiles
  • The Static files doc starts out talking about MapStaticAssets, but then in switches back somewhat abruptly to older content based on UseStaticFiles. I think we want to lead with content based on MapStaticAssets in one cohesive section and then document the older UseStaticFiles support later on in its own section or maybe even in a separate article. Note that both are still supported, so we need to document both.
  • The section on Static files authorization says MapStaticAssets is called before UseAuthorization, but I believe that’s incorrect. It was true for UseStaticFiles, but not for MapStaticAssets. We probably need two versions of this section: one for MapStaticAssets and one for UseStaticFiles.
  • The Blazor docs have their own Static files topic, which also covers a lot of the fundamentals of static files that really apply to any ASP.NET Core app that uses static files. I think we want to elevate as much of this content as possible to ASP.NET Core static files topic and focus the Blazor article and Blazor specific concerns for static files.

@javiercn @mkArtakMSFT @Rick-Anderson @guardrex

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-9.0

Content source URL

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

Document ID

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

Article author

@Rick-Anderson

Related Issues


Associated WorkItem - 350926

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions