Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ public class CounterService
In `Program.cs`:

```csharp
builder.Services.RegisterPersistentService<CounterService>(
RenderMode.InteractiveAuto);
builder.Services.AddRazorComponents()
.RegisterPersistentService<CounterService>(RenderMode.InteractiveAuto);
```

Serialized properties are identified from the actual service instance:
Expand Down
20 changes: 14 additions & 6 deletions aspnetcore/fundamentals/static-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to serve and secure static files and configure Map Static
monikerRange: '>= aspnetcore-3.1'
ms.author: wpickett
ms.custom: mvc
ms.date: 09/02/2025
ms.date: 09/17/2025
uid: fundamentals/static-files
---
# Static files in ASP.NET Core
Expand Down Expand Up @@ -1123,16 +1123,24 @@ Property | Description

Item group | Description | Metadata
--- | ---
`StaticWebAssetContentTypeMapping` | Maps file patterns to content types and cache headers for endpoints. | Pattern, Cache
`StaticWebAssetFingerprintPattern` | Defines patterns for applying fingerprints to static web assets for cache busting. | Pattern, Expression
`StaticWebAssetContentTypeMapping` | Maps file patterns to content types and cache headers for endpoints. | `Pattern`, `Cache`
`StaticWebAssetFingerprintPattern` | Defines patterns for applying fingerprints to static web assets for cache busting. | `Pattern`, `Expression`

Metadata Descriptions:

* **Pattern**: A glob pattern used to match files. For `StaticWebAssetContentTypeMapping`, it matches files to determine their content type (for example, `*.js` for JavaScript files). For `StaticWebAssetFingerprintPattern`, it identifies multi-extension files that require special fingerprinting treatment (for example, `*.lib.module.js`).
* **`Pattern`**: A glob pattern used to match files. For `StaticWebAssetContentTypeMapping`, it matches files to determine their content type (for example, `*.js` for JavaScript files). For `StaticWebAssetFingerprintPattern`, it identifies multi-extension files that require special fingerprinting treatment (for example, `*.lib.module.js`).

* **Cache**: Specifies the `Cache-Control` header value for the matched content type. This controls browser caching behavior (for example, `max-age=3600, must-revalidate` for media files).
* **`Cache`**: Specifies the `Cache-Control` header value for the matched content type. This controls browser caching behavior (for example, `max-age=3600, must-revalidate` for media files).

* **Expression**: Defines how the fingerprint is inserted into the filename. The default is `#[.{fingerprint}]`, which inserts the fingerprint before the extension.
* **`Expression`**: Defines how the fingerprint is inserted into the filename. The default is `#[.{FINGERPRINT}]`, which inserts the fingerprint (`{FINGERPRINT}` placeholder) before the extension.

The following example maps the bitmap file pattern (`.bmp`) to the `image/bmp` content type with the `{CACHE HEADER}` placeholder representing the `Cache-Control` header to use for non-fingerprinted endpoints:

```xml
<ItemGroup>
<StaticWebAssetContentTypeMapping Include="image/bmp" Cache="{CACHE HEADER}" Pattern="*.bmp" />
</ItemGroup>
```

## Runtime configuration options

Expand Down
7 changes: 5 additions & 2 deletions aspnetcore/test/http-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: Use .http files in Visual Studio 2022
author: tdykstra
description: Learn how to use .http files in Visual Studio 2022 to test ASPNET Core apps.
monikerRange: '>= aspnetcore-8.0'
ms.topic: how-to
ms.author: tdykstra
ms.date: 01/19/2024
ms.date: 09/16/2025
ms.topic: how-to
uid: test/http-files
---
# Use .http files in Visual Studio 2022
Expand Down Expand Up @@ -112,6 +112,8 @@ Lines that start with either `#` or `//` are comments. These lines are ignored w
## Variables

A line that starts with `@` defines a variable by using the syntax `@VariableName=Value`.
The variable name is case-sensitive and can't contain any spaces.
The value can contain any characters, including the value `null` to represent a null value.

Variables can be referenced in requests that are defined later in the file. They're referenced by wrapping their names in double curly braces, `{{` and `}}`. The following example shows two variables defined and used in a request:

Expand Down Expand Up @@ -543,6 +545,7 @@ The Visual Studio 2022 `.http` file editor doesn't have all the features that th
* Prompt variables
* Customize response preview
* Per-request settings
* Null-handling variables, e.g. using null-conditional or nullish coalescing operators (this is also unsupported in Visual Studio Code)

## Create an `.http` file

Expand Down
Loading