Ir al contenido

Log template and argument count do not match (CA2017)

Esta página aún no está disponible en tu idioma.

Key dotnet.logging.template-argument-count · Severity error · Category logging

Microsoft analyzer CA2017. Flags a logging call whose message template names a different number of placeholders than it passes arguments. The log entry loses values or fails to format.

_logger.LogInformation("Order {OrderId} paid by {Customer}", order.Id);
_logger.LogInformation("Order {OrderId} paid by {Customer}", order.Id, order.CustomerId);