appcenter-sdk-dotnet icon indicating copy to clipboard operation
appcenter-sdk-dotnet copied to clipboard

Migrate to System.Text.Json

Open tipa opened this issue 2 years ago • 10 comments

System.Text.Json appears to be Microsofts new library for handling JSON. Some libraries from Microsoft are already using it (e.g. the Microsoft Graph .NET SDK).

Are there any plans for migrating the AppCenter SDK to System.Text.Json? This would be appreciated, not only because of the better (de)serialization performance that System.Text.Json offers, but also because of lesser dependencies needed, making my app's binaries smaller.

tipa avatar Nov 03 '21 13:11 tipa

Hi @tipa, thank you for bringing this idea to our attention!

It is a good point! I'll create a feature on our board. The only issue with the migration that I can see now is that we support some dotnet versions which System.Text.Json doesn't support, for example .NET Framework 4.6.1 for WPF. We will need to still use Newtonsoft.Json for such unsupported versions.

DmitriyKirakosyan avatar Nov 03 '21 15:11 DmitriyKirakosyan

Thanks a lot for considering!

for example .NET Framework 4.6.1 for WPF

I've read that .NET Framework 4.6.1 will reach End-off-support early next year. Maybe that makes the decision easier ;)

tipa avatar Nov 03 '21 15:11 tipa

Yep, I was thinking about the this thing too :)

DmitriyKirakosyan avatar Nov 03 '21 15:11 DmitriyKirakosyan

I think .NET Framework 4.6.1 supports .NET Standard 2.0 which is targeted by System.Text.Json. And System.Text.Json has a profile for .NET Framework 4.6.1

michaldobrodenka avatar Nov 24 '21 10:11 michaldobrodenka

Thanks for the information @michaldobrodenka We will take this into account when we do feature.

aleksandr-dorofeev avatar Nov 25 '21 10:11 aleksandr-dorofeev

Just a small reminder that .NET Framework 4.6.1 has reached end-of-support now :) Would love to see System.Text.Json to be used soon!

tipa avatar May 06 '22 10:05 tipa

That will be so great if port the Newtonsoft.JSON to System.Text.Json! How's the progress right now?

laolarou726 avatar Jun 17 '22 19:06 laolarou726

@DmitriyKirakosyan Are there any updates and/or would you accept pull requests for this?

tipa avatar Aug 28 '22 16:08 tipa

@tipa it's in our queue after proper .NET 6 support. No exact ETA yet.

Of course contributions are welcome here

MatkovIvan avatar Aug 29 '22 08:08 MatkovIvan

I checked out the repo and spent multiple hours trying to successfully build the library, without success. It constantly complains about missing references. No idea how this is supposed to work. The actual JSON-bits were easily replaced, but without being able to test them, a PR doesn't make much sense.

tipa avatar Sep 07 '22 16:09 tipa

@MatkovIvan any update on this? thanks!

Panda-Sharp avatar Jan 04 '24 07:01 Panda-Sharp

As the original poster mentioned, Microsoft’s own guidance is to migrate from Newtonsoft.Json to System.Text.Json. This is not only because of the improved (de)serialization performance that System.Text.Json offers, but also because it aligns with Microsoft’s own best practices.

Furthermore, the reduction in dependencies would lead to smaller binary sizes for our apps, which is a significant advantage, especially for mobile applications where every byte counts. This migration would make our apps leaner and more efficient.

Given that this request was made back in November 2021 and it’s now February 2024, I believe it’s high time for this migration to take place. Let’s make our apps better by embracing System.Text.Json!

Thank you for considering this request. I look forward to seeing the AppCenter SDK continue to improve and evolve.

mihaimihaila avatar Feb 14 '24 05:02 mihaimihaila

Hi, currently, we do not have plans for this migration. However, we highly value and welcome your contributions.

MikhailSuendukov avatar Feb 28 '24 15:02 MikhailSuendukov

Do you have any plan for the appcenter-sdk-dotnet in general?

Panda-Sharp avatar Feb 28 '24 17:02 Panda-Sharp