Skip to content

Generated code expects data type to have default ctor despite having [SerializationConstructor] attribute #1904

Description

@AArnott

When migrating the vs-mef repo to v3, the PropertyRef, MethodRef, FieldRef and DiscoveredParts classes all have non-default constructors and the [SerializationConstructor] attribute on a non-default constructor. But the build fails because the source generated formatter tries to invoke a non-existent default constructor.

Attributed private constructors are apparently ignored, which explains the failures of the first 3 listed types.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions