Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.49 KB

File metadata and controls

43 lines (31 loc) · 1.49 KB
title description ms.date f1_keywords helpviewer_keywords author
CA2253: Named placeholders should not be numeric values
Learn about code analysis rule CA2253: Named placeholders should not be numeric values
01/19/2022
CA2253
LoggerMessageDefineAnalyzer
LoggerMessageDefineAnalyzer
CA2253
Youssef1313

CA2253: Named placeholders should not be numeric values

Property Value
Rule ID CA2253
Title Named placeholders should not be numeric values
Category Usage
Fix is breaking or non-breaking Non-breaking
Enabled by default in .NET 8 As suggestion

Cause

A message placeholder consists of numeric characters only.

Rule description

Named placeholders in the logging message template should not be comprised of only numeric characters.

How to fix violations

Rename the numeric placeholder.

For usage examples, see the xref:Microsoft.Extensions.Logging.LoggerExtensions.LogInformation%2A?displayProperty=nameWithType method.

When to suppress errors

Do not suppress a warning from this rule.

See also