Skip to content

TD003 — BiometricTemplate cannot have required properties

A class marked [BiometricTemplate] declares a required property.

The framework creates an empty instance of the template and fills it afterwards. A required property cannot exist on an empty instance.

[BiometricTemplate]
public partial class FingerprintTemplate
{
    public required byte[] TemplateData { get; set; }     // required
}

How to fix it

Remove the required modifier from every property of the template class.

See biometric enrollment.

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.