Add CA2266 analyzer documentation#53992
Open
Copilot wants to merge 16 commits into
Open
Conversation
Copilot created this pull request from a session on behalf of
jjonescz
May 21, 2026 14:30
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds documentation for the new CA2266 analyzer rule (file-based apps shebang requirement) and connects the new rule page to the existing code analysis indexes, TOC navigation, and .NET 10 SDK “file-based apps” content so users can discover it.
Changes:
- Adds a new rule article for CA2266 under code quality rules.
- Updates rule indexes and the .NET 10 “enabled rules” table to include CA2266.
- Adds CA2266 to the tools diagnostics TOC and links to it from the .NET 10 SDK file-based apps section.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/navigate/tools-diagnostics/toc.yml | Adds CA2266 to the Code quality → Usage rules navigation. |
| docs/fundamentals/code-analysis/quality-rules/usage-warnings.md | Adds CA2266 to the Usage rules index table. |
| docs/fundamentals/code-analysis/quality-rules/index.md | Adds CA2266 to the main quality rules index table. |
| docs/fundamentals/code-analysis/quality-rules/ca2266.md | New CA2266 rule documentation page (cause, guidance, suppression, and example). |
| docs/fundamentals/code-analysis/overview.md | Adds CA2266 to the .NET 10 enabled-by-default rules table. |
| docs/core/whats-new/dotnet-10/sdk.md | Links CA2266 from the .NET 10 file-based apps enhancements section. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jjonescz
reviewed
May 21, 2026
jjonescz
reviewed
May 21, 2026
jjonescz
reviewed
May 22, 2026
jjonescz
reviewed
May 22, 2026
BillWagner
approved these changes
May 22, 2026
Member
BillWagner
left a comment
There was a problem hiding this comment.
This LGTM, but I'll let @gewarren check as well.
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.
Related to dotnet/sdk#53749 (comment).
CA2266 was introduced for file-based apps, but the docs set did not include a rule page or links from the analyzer indexes. This change adds the missing rule documentation and wires it into the relevant .NET 10 and code analysis entry points.
New rule article
CA2266: File-based program entry point should start with '#!'Analyzer index updates
Navigation and discovery
Example
Internal previews