在 net8.0 和 net9.0 中,完全移除 Newtonsoft.Json,使用 System.Text.Json#166
Merged
在 net8.0 和 net9.0 中,完全移除 Newtonsoft.Json,使用 System.Text.Json#166
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes Newtonsoft.Json dependency from net8.0 and net9.0 frameworks and transitions to System.Text.Json for IPC object serialization. The change maintains backward compatibility with older frameworks and ensures binary compatibility for IPC communication between applications using different JSON serialization backends.
Key changes:
- Complete removal of Newtonsoft.Json in net8.0+ frameworks, replaced with System.Text.Json
- Maintained support for Newtonsoft.Json in legacy frameworks (net6.0 and below)
- Added framework-specific test configurations to validate both serialization mechanisms
Reviewed Changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/dotnetCampus.Ipc/dotnetCampus.Ipc.csproj | Updated target frameworks and conditional compilation for JSON serializers |
| src/dotnetCampus.Ipc/Serialization/ | Complete rewrite of serialization layer with System.Text.Json support |
| tests/dotnetCampus.Ipc.Tests/ | Added multi-framework testing and framework-specific JSON context |
| src/dotnetCampus.Ipc/CompilerServices/GeneratedProxies/ | Updated proxy generation to work with both JSON serializers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/dotnetCampus.Ipc/CompilerServices/GeneratedProxies/Models/GeneratedProxyObjectModel.cs
Show resolved
Hide resolved
src/dotnetCampus.Ipc/CompilerServices/GeneratedProxies/Models/IpcJsonElement.cs
Show resolved
Hide resolved
lindexi
reviewed
Sep 3, 2025
lindexi
approved these changes
Sep 3, 2025
lindexi
added a commit
to dotnet-campus/DocumentFormat.OpenXml.Extensions
that referenced
this pull request
Sep 5, 2025
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.
重大变更
本次更改
IpcObjectJsonSerializer类型在 net8.0 和 net9.0 中标记为删除且不再可用外,其他二进制和源码都兼容其他说明
单元测试全部通过,这包括了 Newtonsoft.Json 和 System.Text.Json 两个不同 JSON 底层的所有测试,甚至还包括了二者之间互传的兼容。
NuGet 的依赖已更新为如下: