Update logging source generator docs for generic method support, SYSLIB1028, and SYSLIB1029#51839
Update logging source generator docs for generic method support, SYSLIB1028, and SYSLIB1029#51839
Conversation
…llows ref struct restricted Co-authored-by: svick <287848+svick@users.noreply.github.com>
allows ref struct only
…-generation constraints Co-authored-by: svick <287848+svick@users.noreply.github.com>
allows ref struct onlyCo-authored-by: svick <287848+svick@users.noreply.github.com>
Co-authored-by: svick <287848+svick@users.noreply.github.com>
This reverts commit 2c0fe4c.
There was a problem hiding this comment.
Pull request overview
This PR updates the logging source generator documentation to reflect two significant runtime changes in .NET. The changes narrow SYSLIB1011 from blocking all generic methods to only blocking the allows ref struct anti-constraint, and introduce two new diagnostic codes (SYSLIB1028 and SYSLIB1029) for previously undiagnosed parameter restrictions.
Changes:
- SYSLIB1011 narrowed: generic logging methods now supported, except when using the C# 13
allows ref structanti-constraint - Two new diagnostics added: SYSLIB1028 for
params/scopedmodifiers and SYSLIB1029 for ref struct parameter types - Log method constraints updated to reflect the expanded support for generics and explicit restrictions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/fundamentals/syslib-diagnostics/syslib1011.md | Updated to reflect narrowed scope - only blocks allows ref struct constraint, not all generics |
| docs/fundamentals/syslib-diagnostics/syslib1028.md | New diagnostic documentation for unsupported params and scoped parameter modifiers |
| docs/fundamentals/syslib-diagnostics/syslib1029.md | New diagnostic documentation for ref struct parameter types |
| docs/fundamentals/syslib-diagnostics/source-generator-overview.md | Updated table entries for SYSLIB1011, promoted SYSLIB1028/1029 from reserved to documented |
| docs/core/extensions/logging/source-generation.md | Updated constraints section to reflect generic support and explicit modifier/type restrictions |
| f1_keywords: | ||
| - SYSLIB1028 | ||
| --- | ||
|
|
||
| # SYSLIB1028: Argument is using an unsupported parameter modifier |
There was a problem hiding this comment.
The title wording is inconsistent with SYSLIB1024, which uses "the unsupported" instead of "an unsupported". For consistency, consider changing to: "Argument is using the unsupported 'params' or 'scoped' parameter modifier" to match the pattern used in SYSLIB1024.
| f1_keywords: | |
| - SYSLIB1028 | |
| --- | |
| # SYSLIB1028: Argument is using an unsupported parameter modifier | |
| ai-usage: ai-assisted | |
| f1_keywords: | |
| - SYSLIB1028 | |
| --- | |
| # SYSLIB1028: Argument is using the unsupported 'params' or 'scoped' parameter modifier |
| ms.date: 05/07/2021 | ||
| ms.date: 02/23/2026 | ||
| f1_keywords: | ||
| - syslib1011 |
There was a problem hiding this comment.
The f1_keywords value uses lowercase "syslib1011", but newer SYSLIB diagnostic files use uppercase (e.g., "SYSLIB1024", "SYSLIB1028", "SYSLIB1029"). For consistency with the newer convention, consider changing this to "SYSLIB1011".
| - syslib1011 | |
| - SYSLIB1011 |
Reflects two runtime changes to the
LoggerMessageAttributesource generator:allows ref structanti-constraint"paramsandscopedmodifiers are now explicitly diagnosed as SYSLIB1028; ref struct parameter types as SYSLIB1029;ref readonlyis now correctly preservedChanges
syslib1011.md— Updated title, description, and workaround to reflect the narrowed restriction (allows ref structonly)syslib1028.md(new) — Documents SYSLIB1028:paramsandscopedmodifiers unsupported on logging method parameterssyslib1029.md(new) — Documents SYSLIB1029: ref struct types unsupported as logging method parameterssource-generator-overview.md— SYSLIB1011 entry updated; SYSLIB1028/1029 promoted from reserved placeholders to real entries with linkssource-generation.md— "Log method constraints" updated to reflect all changes: generics now valid (exceptallows ref struct),params/scoped/outforbidden, ref struct forbidden,ref readonlysupportedWhat's now valid / invalid
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
Internal previews