description | title | ms.date | ms.topic | f1_keywords | author | ms.author | manager | ms.subservice | monikerRange | |
---|---|---|---|---|---|---|---|---|---|---|
The rule 'RuleId' could not be found. |
CA0061 |
10/20/2016 |
reference |
|
mikejo5000 |
mikejo |
mijacobs |
code-analysis |
vs-2019 |
The rule 'RuleId' could not be found.
This error indicates that the specified rule could not be found.
This warning can be caused by an incorrectly formatted FxCopCmd.exe /RuleId option, an incorrectly formatted CodeAnalysisRules property value, or because the specified rule is in a rule assembly that FxCop is not using.
Use one of the following formats to specify a rule in the FxCopCmd.exe /RuleId option on the FxCopCmd command line:
-
FxCopCmd.exe /RuleId:- Category # RuleId
where Category is the rule category and RuleId is the CheckId of the rule. For example:
FxCopCmd /RuleId:-Microsoft.Design#CA2210
-
FxCopCmd.exe /RuleId:- Namespace # RuleId
where Namespace is the rule category and RuleId is the check id of the rule. For example:
FxCopCmd /RuleId:-Microsoft.Rules.Design#CA2210
In Visual Studio Code analysis, rules can be specified by using the CodeAnalysisRules property of MSBuild with the following format:
<CodeAnalysisRules>-{Category|Namespace}#RuleId[;...]</CodeAnalysisRules>
For example
<CodeAnalysisRules>-Microsoft.Design#CA2210;-Microsoft.Rules.Managed.CA1062</CodeAnalysisRules>