Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/wpfPublic

Remove non-CLS exceptions handlers and CS1058 suppressions (+ cleanup)#10876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
h3xds1nz wants to merge2 commits intodotnet:main
base:main
Choose a base branch
Loading
fromh3xds1nz:non-cls-exceptions-v3

Conversation

h3xds1nz
Copy link
Member

@h3xds1nzh3xds1nz commentedMay 26, 2025
edited
Loading

This is blocked by#10874 /#10875, hence draft.

Description

Removes non-CLS exceptions handlers (general catch handler blocks) inLineServicesCallbacks that are never executed (basically a dead-code). This originates from pre-NetFXv2 /C# 2.0 behaviour before non-CLS exceptions were being wrapped by default asRuntimeWrappedException which derives fromException and hence you needed a generalcatch handler.

Nowadays Roslyn emits[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] by default so all non-CLS exceptions are already handled viacatch (Exception e) blocks and never fallthrough to the generalcatch { } handler.

Customer Impact

Smaller assembly size, codegen size and cleaner codebase for developers.

Regression

No.

Testing

Local build.

Risk

Low, those would be generally caught by CS1058 but the warning was suppressed. Reviewers just need to make sure the removed blocks are preceeded bycatch (Exception e) to achieve the same effect.

Microsoft Reviewers:Open in CodeFlow

rampaa reacted with thumbs up emoji
@h3xds1nzh3xds1nz requested a review froma team as acode ownerMay 26, 2025 09:12
@h3xds1nzh3xds1nz marked this pull request as draftMay 26, 2025 09:13
@dotnet-policy-servicedotnet-policy-servicebot added PRmetadata: Label to tag PRs, to facilitate with triage Community ContributionA label for all community Contributions labelsMay 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dipeshmsftdipeshmsftAwaiting requested review from dipeshmsft

@singhashish-wpfsinghashish-wpfAwaiting requested review from singhashish-wpf

@Kuldeep-MSKuldeep-MSAwaiting requested review from Kuldeep-MS

At least 1 approving review is required to merge this pull request.

Assignees

@h3xds1nzh3xds1nz

Labels
Community ContributionA label for all community ContributionsdraftPRmetadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@h3xds1nz

[8]ページ先頭

©2009-2025 Movatter.jp