CA0063

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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

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

To debug the error, examine your rule set file in a text editor:

  1. To find the path to the rule set file, right-click the project in Solution Explorer, click Properties, and then click Code Analysis. Make sure the rule set file is selected as the active rule set. The path to the rule set is listed in the description field.

  2. Open the rule set file in a text editor.

  3. Examine the Path attribute value in all the Include elements, and verify that they are valid. Include paths can use environment variables, absolute paths, and relative paths (relative to the current rule set file). 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" />
    

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

See also