Skip to content

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

Merged
merged 4 commits into from
Nov 18, 2020
Merged

Update to .NET 5 SDK #5099

merged 4 commits into from
Nov 18, 2020

Conversation

stevejgordon
Copy link
Contributor

One interesting side-effect is a change to System.Text.Json which meant that ErrorWithNullRootCausesTests in the Tests project broke. Deserialisation now attempts to use ctors with parameters. The parameterless ctor is internal, and despite being reachable System.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.

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.
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

LGTM, getting there! 👍

@stevejgordon stevejgordon merged commit fa2edcc into master Nov 18, 2020
@stevejgordon stevejgordon deleted the feature/net5 branch November 18, 2020 13:11
@github-actions
Copy link
Contributor

The backport to 7.10 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 7.10 and the compare/head branch is backport-5099-to-7.10.

@github-actions
Copy link
Contributor

The backport to 7.x failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 7.x and the compare/head branch is backport-5099-to-7.x.

stevejgordon added a commit that referenced this pull request Nov 19, 2020
* 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)
stevejgordon added a commit that referenced this pull request Nov 19, 2020
* 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)
stevejgordon added a commit that referenced this pull request Nov 19, 2020
* 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)
stevejgordon added a commit that referenced this pull request Nov 20, 2020
* 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)
stevejgordon added a commit that referenced this pull request Nov 20, 2020
* 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)
stevejgordon added a commit that referenced this pull request Nov 20, 2020
* 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)
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.

2 participants