microsoft-authentication-library-for-dotnet
microsoft-authentication-library-for-dotnet copied to clipboard
[Feature Request] Use System.Text.Json in Net6-maui targets
Currently System.Text.Json is used only on base net6 target. Other targets use Newtonsoft JSON.NET.
To do - use STJ in Net6-maui targets (the changes should be similar to what was done for net6, see #3605).
- Add to platform_and_feature_flags.props:
<PropertyGroup Condition="'$(TargetFramework)' == '$(TargetFrameworkNet6Android)' Or '$(TargetFramework)' == '$(TargetFrameworkNet6Ios)' Or '$(TargetFramework)' == '$(TargetFrameworkNet6Mac)'">
<DefineConstants>SUPPORTS_SYSTEM_TEXT_JSON;</DefineConstants>
</PropertyGroup>
- Add to MAUI Android and iOS sections in Msal.csproj
<Compile Include="$(PathToMsalSources)\Platforms\net6\**\*.cs" LinkBase="Platforms\net6" />
<Compile Remove="$(PathToMsalSources)\json\**\*.*" />
- Remove Newtonsoft flags from csproj for Net6-maui targets.
- Enable IL trimming for Net6-maui targets.
- Go through classes, update to use STJ instead of Newtonsoft. These classes will all probably be loaded only for mobile platforms, so Newtonsoft code can directly be replaced without the target flags.
https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/tree/pmaytak/stj-maui has partial work.