-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update to .NET 5 SDK #5099
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
Update to .NET 5 SDK #5099
Conversation
The .NET 5 SDK now supports passing a key.
In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, getting there! 👍
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.10 7.10
# Navigate to the new working tree
cd .worktrees/backport-7.10
# Create a new branch
git switch --create backport-5099-to-7.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ---mainline 1 fa2edcc435dd9ede14e57dd75ed3c8d9d417d28b
# Push it to GitHub
git push --set-upstream origin backport-5099-to-7.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.10 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.x 7.x
# Navigate to the new working tree
cd .worktrees/backport-7.x
# Create a new branch
git switch --create backport-5099-to-7.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ---mainline 1 fa2edcc435dd9ede14e57dd75ed3c8d9d417d28b
# Push it to GitHub
git push --set-upstream origin backport-5099-to-7.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.x Then, create a pull request where the |
* Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
* Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
* Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
* Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
* Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
* Update to .NET 5 SDK (#5099) * Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
One interesting side-effect is a change to
System.Text.Json
which meant thatErrorWithNullRootCausesTests
in the Tests project broke. Deserialisation now attempts to use ctors with parameters. The parameterless ctor is internal, and despite being reachableSystem.Text.Json
is still preferring the ctor with params. However, it expects these to match the property names in the JSON so throws an exception.A downside of this is we open up the parameterless constructor. Open to other suggestions here. A wider concern may be how this deserialisation behaves today for anyone using the library in a 5.0 runtime.