Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 347 Bytes

TemplateIsNotCompileTimeConstantProblem.md

File metadata and controls

16 lines (12 loc) · 347 Bytes

Message template is not a compile time constant

Noncompliant Code Examples:

Log.Error($"Disk quota {quota} MB exceeded by {user}");
Log.Error(string.Format("Disk quota {0} MB exceeded by {1}", quota, user));

Compliant Solution:

Log.Error("Disk quota {Quota} MB exceeded by {User}", quota, user);