Fix code squigglies and move snippets#51519
Merged
gewarren merged 2 commits intodotnet:mainfrom Feb 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses issue #42459 by fixing compiler warnings related to nullable EventHandler declarations and relocating code snippets to a more appropriate directory structure.
Changes:
- Adds nullable annotations to EventHandler declarations in C# examples to resolve CS8618 warnings
- Moves Visual Basic and C# code snippets from
samples/snippetstodocs/standard/events/snippets/raise-consumedirectory - Updates markdown documentation to reference the new snippet locations and improves title casing
- Modernizes C# code with primary constructors, target-typed new expressions, and nullable-aware patterns
- Updates target framework from net8.0 to net10.0
Reviewed changes
Copilot reviewed 15 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/standard/events/how-to-raise-and-consume-events.md | Updates snippet paths, applies sentence case to title, fixes xref format for generic EventHandler |
| docs/standard/events/snippets/raise-consume/csharp/*.cs | Adds nullable event handlers, modernizes syntax, moves from old location |
| docs/standard/events/snippets/raise-consume/csharp/project.csproj | Updates target framework to net10.0 |
| docs/standard/events/snippets/raise-consume/vb/*.vb | Refactors to use underscored field naming, wraps in namespaces, moves from old location |
| docs/standard/events/snippets/raise-consume/vb/project.vbproj | New VB project file targeting net10.0 with Library output type |
| samples/snippets/visualbasic/VS_Snippets_CLR/eventsoverview/vb/*.vb | Deletes old VB snippet files |
| docs/standard/events/snippets/raise-consume/csharp/eventsoverview/* | Adds Visual Studio IDE cache and binary files (should not be committed) |
Comments suppressed due to low confidence (1)
docs/standard/events/snippets/raise-consume/csharp/project.csproj:4
- The target framework is set to net10.0, but .NET 10 has not been released yet (as of February 2026). The latest stable .NET version is .NET 9. Using a preview or unreleased version in documentation code samples can cause build failures for users trying to run the examples. Consider using net9.0 or the latest stable version unless there's a specific requirement for .NET 10 features.
BillWagner
approved these changes
Feb 5, 2026
Member
BillWagner
left a comment
There was a problem hiding this comment.
These changes LGTM @gewarren
Let's ![]()
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.
Fixes #42459
Internal previews