Consider the following C # code:
if (atr == null) throw new InvalidOperationException("No ContentProperty attribute found on type.");
When creating the project " CA2204 : literals must be spelled correctly" a warning is issued due to the unrecognized word "ContentProperty".
I know that I can disable the rule (either globally, or only for the containing method), or create my own code analysis dictionary and add "ContentProperty" to it as a recognized word. However, none of these solutions seem attractive to me. Referring to the name of the type or class member in the exception message, a lot happens in my project, which is the application infrastructure.
Does Code Analysis have a way of saying that a word / group of words is not intended for spell checking , for example, when they are surrounded by quotation marks or something else? Or disables the warning only along this path?
c # visual-studio code-analysis
Crono
source share