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
6 changes: 6 additions & 0 deletions aspnetcore/release-notes/aspnetcore-11.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@ This section describes new features for OpenAPI.

This section describes new features for authentication and authorization.

[!INCLUDE[](~/release-notes/aspnetcore-11/includes/identity-time-provider.md)]

## Miscellaneous

This section describes miscellaneous new features in .NET 11.

[!INCLUDE[](~/release-notes/aspnetcore-11/includes/output-cache-policy-provider.md)]

[!INCLUDE[](~/release-notes/aspnetcore-11/includes/development-certificate-trust.md)]

<!-- HOLD - The breaking changes article for 11.0 hasn't been created yet ...

https://learn.microsoft.com/dotnet/core/compatibility/breaking-changes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Auto-trust development certificates in WSL

The development certificate setup now automatically trusts certificates in WSL (Windows Subsystem for Linux) environments. When you run `dotnet dev-certs https --trust` in WSL, the certificate is automatically installed and trusted in both the WSL environment and Windows, eliminating manual trust configuration.

```bash
# Automatically trusts certificates in both WSL and Windows
dotnet dev-certs https --trust
```

This improvement streamlines the development experience when using WSL, removing a common friction point for developers working in Linux environments on Windows.

Thank you [@StickFun](https://github.com/StickFun) for this contribution!
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### `TimeProvider` support in ASP.NET Core Identity

ASP.NET Core Identity now uses `TimeProvider` instead of `DateTime` and `DateTimeOffset` for all time-related operations. This change makes Identity components more testable and provides better control over time in tests and specialized scenarios.

The following example shows how to use a fake `TimeProvider` for testing Identity features:

```csharp
// In tests
var fakeTimeProvider = new FakeTimeProvider(
new DateTimeOffset(2024, 1, 1, 0, 0, 0, TimeSpan.Zero));

services.AddSingleton<TimeProvider>(fakeTimeProvider);
services.AddIdentity<IdentityUser, IdentityRole>();

// Identity will now use the fake time provider
```

By using `TimeProvider`, you can more easily write deterministic tests for time-sensitive Identity features such as token expiration, lockout durations, and security stamp validation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### `IOutputCachePolicyProvider` interface

ASP.NET Core in .NET 11 provides the [IOutputCachePolicyProvider](https://source.dot.net/#Microsoft.AspNetCore.OutputCaching/[IOutputCachePolicyProvider.cs](https://source.dot.net/#Microsoft.AspNetCore.OutputCaching/IOutputCachePolicyProvider.cs)` interface for implementing custom output caching policy selection logic. By using this interface, apps can determine the default base caching policy, check for the existence of named policies, and support advanced scenarios where policies must be resolved dynamically. Examples include loading policies from external configuration sources, databases, or applying tenant-specific caching rules.

The following code shows the `IOutputCachePolicyProvider` interface:

```csharp
public interface IOutputCachePolicyProvider
{
IReadOnlyList<IOutputCachePolicy> GetBasePolicies();
ValueTask<IOutputCachePolicy?> GetPolicyAsync(string policyName);
}
```

<!--
UPDATE 11.0 - Add API cross-reference link when available:
<xref:Microsoft.AspNetCore.OutputCaching.IOutputCachePolicyProvider>
-->

Thank you [@lqlive](https://github.com/lqlive) for this contribution!