Skip to content

Remove Dependency on Newtonsoft.Json From Protocol objects - #1198

Merged
Andrew Arnott (AArnott) merged 3 commits into
microsoft:mainfrom
eerhardt:RefactorJsonRpcObjectToString
Jun 17, 2025
Merged

Remove Dependency on Newtonsoft.Json From Protocol objects#1198
Andrew Arnott (AArnott) merged 3 commits into
microsoft:mainfrom
eerhardt:RefactorJsonRpcObjectToString

Conversation

@eerhardt

Copy link
Copy Markdown
Member

When trimming or native AOT'ing an app, we want to remove Newtonsoft.Json dependencies when possible because it brings in a lot of AOT warnings and adds a lot of size to the final app.

Begin by removing these simple cases in the ToStrings of JsonRpcError, Request, and Result. ToString methods of instantiated types can never be trimmed, so the code in them is always preserved.

cc Andrew Arnott (@AArnott)

When trimming or native AOT'ing an app, we want to remove Newtonsoft.Json dependencies when possible because it brings in a lot of AOT warnings and adds a lot of size to the final app.
Begin by removing these simple cases in the ToStrings of JsonRpcError, Request, and Result. ToString methods of instantiated types can never be trimmed, so the code in them is always preserved.

@AArnottAndrew Arnott (AArnott) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks very good.

Comment threadtest/StreamJsonRpc.Tests/Protocol/JsonRpcRequestTests.cs Outdated

@AArnottAndrew Arnott (AArnott) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/azp run

@AArnott

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

Sign up for freeto 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

@eerhardt@AArnott