Skip to content

Fix code example for CA5362 - #55181

Merged
gewarren merged 3 commits into
dotnet:mainfrom
gewarren:ca5362
Jul 30, 2026
Merged

Fix code example for CA5362#55181
gewarren merged 3 commits into
dotnet:mainfrom
gewarren:ca5362

Conversation

@gewarren

@gewarren gewarren commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI review requested due to automatic review settings July 29, 2026 16:05
@gewarren
gewarren requested a review from a team as a code owner July 29, 2026 16:05
@dotnetrepoman dotnetrepoman Bot added this to the July 2026 milestone Jul 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the CA5362 documentation’s solution example so it no longer applies [NonSerialized] to an invalid target (a property), addressing #55114.

Changes:

  • Added a new C# snippet file for the CA5362 solution example.
  • Updated ca5362.md to correct the pseudo-code example, improve wording/formatting, and reference the external snippet via :::code.
  • Updated ms.date to reflect the edit date.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca5362.cs Adds the solution snippet, but needs snippet marker/id alignment to ensure extraction works.
docs/fundamentals/code-analysis/quality-rules/ca5362.md Updates the article’s examples and replaces inline solution code with a :::code include.

Comment thread docs/fundamentals/code-analysis/quality-rules/ca5362.md Outdated
@gewarren
gewarren enabled auto-merge (squash) July 29, 2026 16:13
Comment thread docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca5362.cs Outdated
Comment thread docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca5362.cs Outdated
Comment thread docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca5362.cs Outdated

@wadepickett wadepickett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gewarren: Some minor suggestions to review that I noted inline.

Co-authored-by: Wade Pickett <wpickett@microsoft.com>

@wadepickett wadepickett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, great work!

@gewarren
gewarren merged commit 5f5cbac into dotnet:main Jul 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CA5362 Solution example-code is invalid

3 participants