Share via


CA0063

Failed to load rule set file or one of its dependent rule set files.

Failed to load rule set file or one of its dependent rule set files.

The specified ruleset could not be found or one of the ruleset files included in your ruleset could not be found. Make sure that the all the rulesets included in your ruleset exist on disk and that the appropriate ruleset directories are being specified in your project through the CodeAnalysisRuleSetDirectories property of MSBuild.

To debug the error, examine your ruleset file in a text editor. To find the path to the ruleset file, right-click the project in Solution Explorer, click Properties, and then click Code Analysis. Make sure the ruleset file is selected in Run this rule set. The Path to the rule set is listed in the description field.

Examine the Path attribute value all the Include elements. Include paths can use relative paths to the parent/current ruleset file, environment variables, and absolute paths. For example:

<Include Path="%PUBLIC%\Documents\RuleSets\alldesign.ruleset" Action="Default" />
<Include Path="..\alldesign.ruleset" Action="Default" />
<Include Path="C:\Rulesets\alldesign.ruleset" Action="Default" />

Inspect each of these include paths and verify they are all valid.

In some cases, the location of a ruleset can be dependent on an MSBuild property. MSBuild properties cannot be referenced from a ruleset. To work around this issue, specify additional search paths in the CodeAnalysisRuleSetDirectories property of MSBuild. In this scenario, specify only the name of the ruleset in the Path attribute of the Include element.

See Also