CodeAnalysisRuleSetDirectories
not respected
#52915
Labels
Milestone
CodeAnalysisRuleSetDirectories
not respected
#52915
Background
We're using a nuget package to distribute code analysis rule set (.ruleset) file as a default within our enterprise. In order to replace
or extend this default rule set,
CodeAnalysisRuleSet
property may be set on .csproj level to point to a custom .ruleset file.One rule set file may include a number of other rule set files using
Include
element. However, included rule set files would not get resolved unless specified with their full path.Issue
Specifying the directory of a .ruleset file via
CodeAnalysisRuleSetDirectories
property should allow setting the file name only in //RuleSet/Include/@path rather than full path. However, neither setting CodeAnalysisRuleSetDirectories in a nuget package props file nor in the csproj directly seems to work as expected, i.e. corresponding .ruleset files would not be resolved by VS/msbuild.MyProject.csproj
Style.ruleset
Expected Behavior
File C:\nuget-package-location\rulesets\enterprise.ruleset gets resolved by setting
CodeAnalysisRuleSetDirectories
property to C:\nuget-package-location\rulesets\ in MyProject.csproj and setting //RuleSet/Include/@path="enterprise.ruleset" in Style.ruleset.Environment
Visual Studio Professional 2019 16.9.4
Windows 10 Pro 20H2
The text was updated successfully, but these errors were encountered: