Skip to content

[Breaking change]: JSON source-gen API refactoring causes binary-compat breaking change #26200

@layomia

Description

@layomia

Description

In dotnet/runtime#59243, we updated the APIs that the output of the JSON source generator calls to make them easier to extend with new features in the future. This will result in projects that explicitly use the JSON source generator and were compiled with .NET RC 1 or earlier to fail with runtime exceptions when run on the .NET RC 2 runtime.

Version

.NET 6 RC2

Previous behavior

Projects that were compiled using the RC1 version of the STJ source generator & library run as expected.

New behavior

Projects that were compiled using the RC1 version of the STJ source generator & library fail when run against the RC 2 runtime. Projects that are recompiled with the RC 2 SDK work as expected.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

To make the source-generator implementation easier to extend with features in the future. More background here: dotnet/runtime#59243 (comment).

Recommended action

Recompile your applications using the RC 2 SDK.

Feature area

Core .NET libraries

Affected APIs

Usage of

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 6Issues and PRs for the .NET 6 releasebinary incompatibleExisting binaries may encounter a breaking change in behavior.breaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions