Open sandboxFocusImprove this doc

LAMA0209: The base type declares several serializers

Severity Error
Reported by Metalama.Framework
Message Cannot generate a compile-time serializer for '<Type>' because the base type '<BaseType>' declares several nested types that implement ISerializer.

Cause

Metalama generates a serializer for each type implementing ICompileTimeSerializable, unless the type declares its own. When the base type is also serializable, the generated serializer derives from the serializer of the base type, which can be a manual serializer: a nested type of the base type that implements ISerializer.

Metalama reports LAMA0209 when it generates the serializer of a type, <Type> in the message, and finds more than one nested serializer in the base type, <BaseType>, so it can't choose the serializer to derive from.

When the project is built, Metalama checks the base type first. It reports LAMA0208 on the base type and stops before it generates the serializer of the derived type, so the build output contains LAMA0208 but not LAMA0209. In the IDE, the analysis continues after LAMA0208, so Metalama reports LAMA0208 on the base type and LAMA0209 on the derived type.

Resolution

Keep a single nested type implementing ISerializer in the base type, as described in LAMA0208. If you don't own the base type, contact its author.

See also