Skip to content

Harden metadata handler invoker against bad metadata - #47433

Merged
tmat merged 3 commits into
dotnet:release/9.0.3xxfrom
tmat:BadAssembly
Mar 20, 2025
Merged

tmat merged 3 commits into
dotnet:release/9.0.3xxfrom
tmat:BadAssembly

Conversation

@tmat

@tmat tmat commented Mar 11, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 11, 2025 00:41
@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Mar 11, 2025

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.

PR Overview

This PR strengthens the robustness of the MetadataUpdateHandlerInvoker by gracefully handling cases where assembly metadata retrieval might fail.

  • Introduces try-catch blocks around GetName() and GetReferencedAssemblies() calls.
  • Returns early or assigns default values when metadata access fails.

Reviewed Changes

File Description
src/BuiltInTools/HotReloadAgent/MetadataUpdateHandlerInvoker.cs Added error handling to protect against exceptions when reading assembly metadata

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/BuiltInTools/HotReloadAgent/MetadataUpdateHandlerInvoker.cs
@tmat

tmat commented Mar 11, 2025

Copy link
Copy Markdown
Member Author

@phil-allen-msft ptal

Comment thread src/BuiltInTools/HotReloadAgent/MetadataUpdateHandlerInvoker.cs Outdated
Comment thread src/BuiltInTools/HotReloadAgent/MetadataUpdateHandlerInvoker.cs Outdated
@tmat
tmat merged commit c7a08c9 into dotnet:release/9.0.3xx Mar 20, 2025
@tmat
tmat deleted the BadAssembly branch March 20, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Infrastructure untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants