Reputation: 12978
Where can I find the set of rules used for code analysis in Visual Studio Express for Desktop 2013?
As I understand it, only a limited ruleset is supported in the Express versions of Visual Studio, but I can't find any documentation as to which rules are applied.
I'm guessing it may be the Managed Minimun Rules rule set for managed code, but the MSDN documentation is not explicity, only saying:
These rules are small in number and they are intended only to run in limited Visual Studio editions. Use MinimumRecommendedRules.ruleset with other Visual Studio editions.
Upvotes: 4
Views: 1201
Reputation: 1
the ManagedMinimumRules.ruleset can be changed.
disable the readonly file property, use Admin mode to launch text editor and save it then run Code Analysis again (need not to close VS)
Action.Info and Hidden are not supported
Upvotes: 0
Reputation: 1120
It seems like the Express edition can not edit the rule sets, but the rules are supported. (At least for Visual Studio 2015 Express.)
I edited some rules in the Community Edition and saved it to project. And after this, these rules were applied even in the Express. Unfortunately I also was not able to find any description.
If you want to add extended rules to project, add/update some lines in project file:
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>MyProject.ruleset</CodeAnalysisRuleSet>
to your project for all configurations; where the MyProject
is project name. (the RunCodeAnalysis
line should be already there)
And the MyProject.ruleset file (example) is:
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Rules for MyProject" Description="Code analysis rules for MyProject.csproj." ToolsVersion="14.0">
<IncludeAll Action="Warning" />
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA2210" Action="None" />
<Rule Id="CA1824" Action="None" />
<Rule Id="CA1300" Action="None" />
</Rules>
</RuleSet>
This example is based on AllRules.ruleset
(when I'm not wrong). The example above disables three rules, that should not be reported.
Available Actions are:
None
to disable warning, Info
(seems that it do not work in this example, probably has something to do with the include action type),Warning
Error
Hidden
EDIT:
It seems like not all methods _(from Community Edition) are supported in Express Edition. But at least it is still more than the standardly defined rule-set. To address you original question, the list of rule set is not editable, but you can find it in the only file *.ruleset file in the Visual Studio directory (c:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets\ManagedMinimumRules.ruleset
)
e.g. CA1303: Do not pass literals as localized parameters is not supported/reported in Express edition.
Upvotes: 1