Skip to content

Update sample to use app.MapStaticAssets(staticAssetsManifestPath: myManifestKey); #33059

Open
@Rick-Anderson

Description

@Rick-Anderson

Description

Update the following code to use a manifest file and replace any app.UseStaticFiles(new StaticFileOptions code with

var myManifestKey = builder.Configuration["MyManifestPath"]
         ?? "manifests/manifest.json";

/// other code

 app.MapStaticAssets(staticAssetsManifestPath: myManifestKey);

Helpful links:

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-8.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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions