Update logging source generator docs for generic support, SYSLIB1028, and SYSLIB1029#51839
Open
Update logging source generator docs for generic support, SYSLIB1028, and SYSLIB1029#51839
Conversation
…llows ref struct restricted Co-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update logging source generator documentation for changes
Update logging source generator docs: SYSLIB1011 now scoped to Feb 23, 2026
allows ref struct only
This was referenced Feb 23, 2026
…-generation constraints Co-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot
AI
changed the title
Update logging source generator docs: SYSLIB1011 now scoped to
Update logging source generator docs for SYSLIB1028/1029 and generic method support
Feb 25, 2026
allows ref struct onlyCo-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot
AI
changed the title
Update logging source generator docs for SYSLIB1028/1029 and generic method support
Update logging source generator docs: SYSLIB1011, SYSLIB1028, SYSLIB1029
Feb 25, 2026
Copilot stopped work on behalf of
svick due to an error
February 27, 2026 10:44
Co-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot
AI
changed the title
Update logging source generator docs: SYSLIB1011, SYSLIB1028, SYSLIB1029
Update logging source generator docs for generic method support, SYSLIB1028, and SYSLIB1029
Feb 27, 2026
This reverts commit 2c0fe4c.
svick
approved these changes
Feb 27, 2026
Contributor
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 |
Co-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot
AI
changed the title
Update logging source generator docs for generic method support, SYSLIB1028, and SYSLIB1029
Update logging source generator docs for generic support, SYSLIB1028, and SYSLIB1029
Mar 2, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
svick
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents two changes to the
LoggerMessageAttributesource generator (#124638, #124589) that expand what's supported and tighten what's explicitly diagnosed.SYSLIB1011 — narrowed restriction (
#124638)Generic logging methods are now fully supported. SYSLIB1011 fires only when a type parameter uses the C# 13
allows ref structanti-constraint (the generator stores parameters in struct fields and can't hold ref struct type arguments).syslib1011.md— title/description updated from "cannot be generic" → "cannot use theallows ref structconstraint"SYSLIB1028 and SYSLIB1029 — new diagnostics (
#124589)paramsandscopedmodifiers are now explicitly rejected (SYSLIB1028); ref struct parameter types are rejected (SYSLIB1029). Theref readonlymodifier is preserved correctly.syslib1028.md(new) —paramsandscopedmodifiers unsupportedsyslib1029.md(new) — ref struct parameter types unsupportedsource-generator-overview.md— SYSLIB1011/1028/1029 table entries updated; 1028/1029 promoted from reserved placeholders to linked entriessource-generation.md— "Log method constraints" list updated to reflect all changes; notesref readonlyis supported.openpublishing.redirection.fundamentals.json— removed stale redirect entries for the two new pages (caused build warnings)🔒 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
allows ref structconstraint