Skip to content

Commit c8cd9ec

Browse files
authored
Added details for the CS rule (#32808)
* Added details for the CS rule * Add related link
1 parent 0961883 commit c8cd9ec

File tree

1 file changed

+2
-2
lines changed
  • docs/fundamentals/code-analysis/quality-rules

1 file changed

+2
-2
lines changed

docs/fundamentals/code-analysis/quality-rules/ca2254.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CA2254: Template should be a static expression"
33
description: "Learn about code analysis rule CA2254: Template should be a static expression"
4-
ms.date: 01/19/2022
4+
ms.date: 11/30/2022
55
ms.topic: reference
66
f1_keywords:
77
- CA2254
@@ -21,7 +21,7 @@ author: Youssef1313
2121

2222
## Cause
2323

24-
A message template passed to a logger API is not constant.
24+
A message template passed to a logger API is not constant. This occurs when the template passed uses either string concatenation or interpolation. Instead, the template should be a constant value that represents the log message in _message template format_. For example: `"User {User} logged in from {Address}"`. For more information, see [Log message template formatting](../../../core/extensions/logging.md#log-message-template-formatting).
2525

2626
## Rule description
2727

0 commit comments

Comments
 (0)