Skip to content

TD002 — TemplateData class has no serializable properties

A class marked [BinarySerializedBlob] or [BiometricTemplate] has no property the generator can serialize.

The generator serializes public properties with both a getter and a setter, of type byte[], byte[][], or a primitive (byte, sbyte, short, ushort, int, uint, long, ulong, float, double, bool, string). Nothing else counts.

[BiometricTemplate]
public partial class FingerprintTemplate
{
    public byte[] TemplateData { get; }    // no setter: skipped
}

Why the build warns

The generator emits no serialization code for the class. The class cannot be stored or restored.

How to fix it

Give the class at least one public byte[], byte[][], or primitive property with get; set;.

If you disagree with a report

Do not suppress it. A wrong report is a bug in the check — report it with the code that triggered it.