Skip to content

Refactor reflection usage to only reflection against the one method - #1199

Merged
Andrew Arnott (AArnott) merged 1 commit into
microsoft:mainfrom
eerhardt:RemoveUnnecessaryReflection
Jun 13, 2025
Merged

Andrew Arnott (AArnott) merged 1 commit into
microsoft:mainfrom
eerhardt:RemoveUnnecessaryReflection

Conversation

@eerhardt

Copy link
Copy Markdown
Member

Reflecting on all methods on the Type preserves all methods on the Type, which causes more code to be kept than is actually used in the app.

Instead, use a reflection pattern that targets the specific method being reflected on.

With the current code, all methods on JsonRpc are being preserved, causing things like Newtonsoft.Json to be kept in the app even though it is not used.

cc Andrew Arnott (@AArnott)

Reflecting on all methods on the Type preserves all methods on the Type, which causes more code to be kept than is actually used in the app.

Instead, use a reflection pattern that targets the specific method being reflected on.
@AArnott

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AArnott
Andrew Arnott (AArnott) merged commit e02b029 into microsoft:main Jun 13, 2025
@eerhardt
Eric Erhardt (eerhardt) deleted the RemoveUnnecessaryReflection branch June 16, 2025 15:23
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.

2 participants