Description
Properties of a base record defined in a referenced NuGet package are ignored when creating a JsonSerializerContext.
When working with classes it is working as expected.
Reproduction Steps
Create a project with a record:
public record FooData
{
public virtual int FooValue { get; set; }
}
Create a NuGet package.
Create a second project and reference the NuGet package:
public record BarData : Foo.FooData
{
public int BarValue { get; set; }
}
Create a JsonSerializerContext:
[JsonSerializable(typeof(BarData))]
public partial class BarJsonSerializerContext : JsonSerializerContext { }
Expected behavior
The generated context (BarJsonSerializerContext) should handle FooValue and BarValue.
Actual behavior
The generated context (BarJsonSerializerContext) handles only BarValue.
Regression?
No response
Known Workarounds
Reference the project with the base types directly if possible instead of using a NuGet package.
Configuration
.net 6.0.100
Other information
No response