Skip to content

Use Newtonsoft.Json.Bson except in NetCore projects #370

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented Nov 23, 2022

  • avoid obsolete BsonReader and BsonWriter classes
    • use NETFX_CORE for remaining legacy case (for now)
  • remove NEWTONSOFTJSON10 define; need only NETFX_CORE now

Comment on lines -265 to +268
#if NEWTONSOFTJSON10 // Json.NET 10's Bson package calculates the path in some exceptions differently.
string expectedPath = "Value";
#else
#if NETFX_CORE // Separate Bson package (not yet used in NETCore project) calculates the path in exceptions differently
string expectedPath = string.Empty;
#else
string expectedPath = "Value";

Choose a reason for hiding this comment

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

Just to confirm, this inversion in logic was intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We have 3 Http.Formatting projects in src: NetCore for Profile259 (which is supposed to be similar to netstandard1.3 but is actually a superset in some ways), NetStandard for netstandard2.0, and "regular" for .NET Framework. Previously only the NetStandard project defined NEWTONSOFTJSON10 and used the Json.Bson package. Now all but the NetCore project uses Json.Bson. That project defines NETFX_CORE.

Base automatically changed from dougbu/Newtonsoft.Json.part3 to main November 24, 2022 01:55
- avoid obsolete `BsonReader` and `BsonWriter` classes
  - use `NETFX_CORE` for remaining legacy case (for now)
- remove `NEWTONSOFTJSON10` define; need only `NETFX_CORE` now
@dougbu dougbu force-pushed the dougbu/Newtonsoft.Json.part4 branch from b7a1be2 to 2cdd25b Compare November 24, 2022 02:36
@dougbu dougbu merged commit 3e2e11b into main Nov 24, 2022
@dougbu dougbu deleted the dougbu/Newtonsoft.Json.part4 branch November 24, 2022 03:26
@dougbu dougbu added this to the 3.3.0 (5.3.0) milestone Feb 26, 2023
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.

3 participants