You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reformat examples: content first, metadata in footer blocks
New format per file:
## Heading (H2)
Actual content (copy/paste from original)
---
Source: link to original
Commentary: why it was selected
Why it works: what makes it effective
---
Clear separation between the example content and the editorial
commentary. Content reads exactly as it would in release notes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
> Source: [.NET 10 Preview 7 — ASP.NET Core](../../../../release-notes/10.0/preview/preview7/aspnetcore.md)
5
+
A new configuration option has been added to the [ASP.NET Core exception handler middleware](https://learn.microsoft.com/aspnet/core/fundamentals/error-handling#exception-handler-page) to control diagnostic output: `ExceptionHandlerOptions.SuppressDiagnosticsCallback`. This callback is passed context about the request and exception, allowing you to add logic that determines whether the middleware should write exception logs and other telemetry.
6
6
7
-
Short — three sentences covering the new option, the use case, and a behavior change. No code needed.
7
+
This setting is useful when you know an exception is transient, or has been handled by the exception handler middleware, and don't want the error logs written to your observability platform.
8
8
9
-
> A new configuration option has been added to the [ASP.NET Core exception handler middleware](https://learn.microsoft.com/aspnet/core/fundamentals/error-handling#exception-handler-page) to control diagnostic output: `ExceptionHandlerOptions.SuppressDiagnosticsCallback`. This callback is passed context about the request and exception, allowing you to add logic that determines whether the middleware should write exception logs and other telemetry.
10
-
>
11
-
> This setting is useful when you know an exception is transient, or has been handled by the exception handler middleware, and don't want the error logs written to your observability platform.
12
-
>
13
-
> Additionally, the middleware's default behavior has changed: it no longer writes exception diagnostics for exceptions handled by `IExceptionHandler`. Based on user feedback, logging handled exceptions at the error level was often undesirable when `IExceptionHandler.TryHandleAsync` returned `true`.
9
+
Additionally, the middleware's default behavior has changed: it no longer writes exception diagnostics for exceptions handled by `IExceptionHandler`. Based on user feedback, logging handled exceptions at the error level was often undesirable when `IExceptionHandler.TryHandleAsync` returned `true`.
14
10
15
-
**Why it works**: concise problem/solution. The reader immediately knows what changed, why, and whether they're affected.
11
+
---
12
+
Source: [.NET 10 Preview 7 — ASP.NET Core](../../../../release-notes/10.0/preview/preview7/aspnetcore.md)
13
+
Commentary: Short and focused — three sentences covering the new option, the use case, and a behavior change. No code needed.
14
+
Why it works: The reader immediately knows what changed, why, and whether they're affected.
16
15
17
16
---
18
17
19
18
## Use PipeReader support in System.Text.Json
20
19
21
-
> Source: [.NET 10 Preview 7 — ASP.NET Core](../../../../release-notes/10.0/preview/preview7/aspnetcore.md)
20
+
MVC, Minimal APIs, and the `HttpRequestJsonExtensions.ReadFromJsonAsync` methods have all been updated to use the new PipeReader support in System.Text.Json without requiring any code changes from applications.
22
21
23
-
Medium — behavioral change with workaround guidance and two code samples (quick fix and optimal fix).
22
+
For the majority of applications this should have no impact on behavior. However, if the application is using a custom `JsonConverter`, there is a chance that the converter doesn't handle [Utf8JsonReader.HasValueSequence](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader.hasvaluesequence) correctly. This can result in missing data and errors like `ArgumentOutOfRangeException` when deserializing.
24
23
25
-
> MVC, Minimal APIs, and the `HttpRequestJsonExtensions.ReadFromJsonAsync` methods have all been updated to use the new PipeReader support in System.Text.Json without requiring any code changes from applications.
26
-
>
27
-
> For the majority of applications this should have no impact on behavior. However, if the application is using a custom `JsonConverter`, there is a chance that the converter doesn't handle `Utf8JsonReader.HasValueSequence` correctly. This can result in missing data and errors like `ArgumentOutOfRangeException` when deserializing.
28
-
>
29
-
> The quick workaround (especially if you don't own the custom `JsonConverter` being used) is to set the `"Microsoft.AspNetCore.UseStreamBasedJsonParsing"` AppContext switch to `true`. This should be a temporary workaround and the `JsonConverter`(s) should be updated to support `HasValueSequence`.
24
+
The quick workaround (especially if you don't own the custom `JsonConverter` being used) is to set the `"Microsoft.AspNetCore.UseStreamBasedJsonParsing"`[AppContext](https://learn.microsoft.com/dotnet/api/system.appcontext) switch to `true`. This should be a temporary workaround and the `JsonConverter`(s) should be updated to support `HasValueSequence`.
25
+
26
+
To fix `JsonConverter` implementations, there is the quick fix which allocates an array from the `ReadOnlySequence`:
@@ -36,28 +33,27 @@ public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSeria
36
33
}
37
34
```
38
35
39
-
**Why it works**: acknowledges most users won't notice, identifies who *will* be affected, gives an immediate workaround, then the proper fix. Good template for "mostly invisible but has an edge case."
40
-
41
36
---
37
+
Source: [.NET 10 Preview 7 — ASP.NET Core](../../../../release-notes/10.0/preview/preview7/aspnetcore.md)
38
+
Commentary: Medium — behavioral change that's mostly invisible but has an edge case. Gives the workaround and the proper fix.
39
+
Why it works: Acknowledges most users won't notice, identifies who *will* be affected, gives an immediate workaround, then the proper fix.
42
40
43
-
## OpenIdConnectHandler support for Pushed Authorization Requests (PAR)
41
+
---
44
42
45
-
> Source: [.NET 9 Preview 7 — ASP.NET Core](../../../../release-notes/9.0/preview/preview7/aspnetcore.md)
43
+
## `OpenIdConnectHandler` support for Pushed Authorization Requests (PAR)
46
44
47
-
Long — community contribution with extensive quoted motivation, configuration example, and operational guidance.
45
+
We'd like to thank @josephdecock from @DuendeSoftware for adding Pushed Authorization Requests (PAR) to ASP.NET Core's `OpenIdConnectHandler`. Joe described the background and motivation for enabling PAR in [his API proposal](https://github.com/dotnet/aspnetcore/issues/51686) as follows:
48
46
49
-
> We'd like to thank @josephdecock from @DuendeSoftware for adding Pushed Authorization Requests (PAR) to ASP.NET Core's `OpenIdConnectHandler`. Joe described the background and motivation for enabling PAR in [his API proposal](https://github.com/dotnet/aspnetcore/issues/51686) as follows:
47
+
> Pushed Authorization Requests (PAR) is a relatively new [OAuth standard](https://datatracker.ietf.org/doc/html/rfc9126) that improves the security of OAuth and OIDC flows by moving authorization parameters from the front channel to the back channel (that is, from redirect URLs in the browser to direct machine to machine http calls on the back end).
48
+
>
49
+
> This prevents an attacker in the browser from:
50
50
>
51
-
> > Pushed Authorization Requests (PAR) is a relatively new [OAuth standard](https://datatracker.ietf.org/doc/html/rfc9126) that improves the security of OAuth and OIDC flows by moving authorization parameters from the front channel to the back channel (that is, from redirect URLs in the browser to direct machine to machine http calls on the back end).
52
-
> >
53
-
> > This prevents an attacker in the browser from:
54
-
> >
55
-
> > - Seeing authorization parameters (which could leak PII) and from
56
-
> > - Tampering with those parameters (e.g., the attacker could change the scope of access being requested).
57
-
> >
58
-
> > The use of PAR is encouraged by the [FAPI working group](https://openid.net/wg/fapi/) within the OpenID Foundation.
51
+
> - Seeing authorization parameters (which could leak PII) and from
52
+
> - Tampering with those parameters (e.g., the attacker could change the scope of access being requested).
53
+
>
54
+
> The use of PAR is encouraged by the [FAPI working group](https://openid.net/wg/fapi/) within the OpenID Foundation.
59
55
60
-
> PAR is now enabled by default if the identity provider's discovery document advertises support for it. This change should provide enhanced security for providers that support PAR. If this causes problems, disable PAR via `OpenIdConnectOptions.PushedAuthorizationBehavior`:
56
+
PAR is now enabled by default if the identity provider's discovery document advertises support for it. The identity provider's discovery document is usually found at `.well-known/openid-configuration`. This change should provide enhanced security for providers that support PAR. If this causes problems, disable PAR via `OpenIdConnectOptions.PushedAuthorizationBehavior` as follows:
61
57
62
58
```csharp
63
59
builder.Services
@@ -74,6 +70,13 @@ builder.Services
74
70
});
75
71
```
76
72
77
-
> To ensure that authentication only succeeds if PAR is used, use `PushedAuthorizationBehavior.Require`.
73
+
To ensure that authentication only succeeds if PAR is used, use `PushedAuthorizationBehavior.Require`.
74
+
75
+
This change also introduces a new `OnPushAuthorization` event to `OpenIdConnectEvents` which can be used to customize the pushed authorization request or handle it manually. Refer to the [API proposal](https://github.com/dotnet/aspnetcore/issues/51686) for more details.
78
76
79
-
**Why it works**: the block quote lets the contributor explain the significance in their own words — more credible than the agent paraphrasing. Then practical: default behavior, how to disable, how to require. Good template for features with security or compliance significance.
77
+
---
78
+
Source: [.NET 9 Preview 7 — ASP.NET Core](../../../../release-notes/9.0/preview/preview7/aspnetcore.md)
79
+
Commentary: Long — community contribution with the contributor's own words explaining significance. Good template for features with security or compliance importance.
80
+
Why it works: The block quote lets the contributor explain the significance — more credible than paraphrasing. Then practical: default behavior, how to disable, how to require.
Medium — one sentence of context, then a code block showing the new syntax, then rule bullets. Code-first because the syntax *is* the feature.
8
-
9
-
> The new extension blocks now include support for *operators*, with the exception of implicit and explicit conversion operators. You can declare operators in extension blocks, as shown in the following example:
5
+
The new extension blocks now include support for *operators*, with the exception of implicit and explicit conversion operators. You can declare operators in extension blocks, as shown in the following example:
10
6
11
7
```csharp
12
8
publicstaticclassOperators
@@ -22,11 +18,18 @@ public static class Operators
22
18
}
23
19
```
24
20
25
-
> Several of the rules for extension operators are demonstrated in the preceding example:
26
-
>
27
-
> - At least one of the operands must be the *extended type*, `TElement[]` in the preceding example.
28
-
> - For operators that require pair-wise declarations, such as `==` and `!=`, both operators must be declared in the same static class.
29
-
> - Instance compound assignment operators, and instance increment and decrement operators are expected to mutate the current instance.
30
-
> - Extension operators, like other extension members, can't use the `abstract`, `virtual`, `override`, or `sealed` modifiers.
21
+
Several of the rules for extension operators are demonstrated in the preceding example:
22
+
23
+
- At least one of the operands must be the *extended type*, `TElement[]` in the preceding example.
24
+
- For operators that require pair-wise declarations, such as `==` and `!=` in the preceding example, both operators must be declared in the same static class. They are not required to be in the same `extension` container.
25
+
- Instance compound assignment operators, and instance increment and decrement operators are expected to mutate the current instance. Therefore reference type parameters must be passed by value and value type parameters must be passed by `ref`. These operators can't be declared when the extended type is an unconstrained type parameter.
26
+
- Extension operators, like other extension members, can't use the `abstract`, `virtual`, `override`, or `sealed` modifiers. This is consistent with other extension members.
27
+
28
+
Extension members are only considered for overload resolution when no applicable predefined or user defined non-extension members are found.
Commentary: Code-first — one sentence of context, then the syntax, then rule bullets. Language features need to be seen, not just described.
33
+
Why it works: Shows the code immediately. The rule bullets follow naturally as "here's what you need to know." No motivation section needed.
31
34
32
-
**Why it works**: shows the code immediately — language features need to be seen, not just described. The rule bullets follow naturally as "here's what you need to know." No motivation section needed because C# developers will already understand why extension operators are useful.
> Additionally, this release added support for HashML-DSA, which we call "PreHash" to help distinguish it from "pure" ML-DSA.
22
+
Additionally, this release added support for HashML-DSA, which we call "PreHash" to help distinguish it from "pure" ML-DSA. As the underlying specification interacts with the Object Identifier (OID) value, the SignPreHash and VerifyPreHash methods on this `[Experimental]` type take the dotted-decimal OID as a string. This may evolve as more scenarios using HashML-DSA become well-defined.
> This release also introduces new types to support ietf-lamps-pq-composite-sigs (currently at draft 7), and an implementation of the primitive methods for RSA variants.
32
+
### Composite ML-DSA
33
+
34
+
This release also introduces new types to support ietf-lamps-pq-composite-sigs (currently at draft 7), and an implementation of the primitive methods for RSA variants.
**Why it works**: the `diff` block for ML-DSA immediately shows the simplification — red lines removed, green line added. Subheadings organize related-but-distinct features. The Composite ML-DSA sample is a complete, runnable scenario (generate → sign → verify → tamper → verify-fails).
Commentary: Long — subheadings organize related-but-distinct features. Uses `diff` blocks for API simplification and complete runnable scenarios for new APIs.
54
+
Why it works: The `diff` block immediately shows the simplification (red lines removed, green line added). The Composite ML-DSA sample is a complete scenario (generate → sign → verify → tamper → verify-fails).
0 commit comments