FxCop的UI并未提供Phoenix engine的支持,也就是以下这些验证规则通过FxCop的 UI没有办法验证,但是可以通过FxCopCmd来验证
CA1062 Validate Arguments of Public Methods
CA1303 Do Not Pass Literals as Localized Parameters
CA2000 Dispose Objects Before Losing Scope
CA2100 Review SQL Queries For Security Vulnerabilities
CA2202 Do Not Dispose Objects Multiple Times
CA2204 Literals Should Be Spelled Correctly
CA2215 Dispose Methods Should Call Base Class Dispose
CA2241 Provide Correct Arguments to Formatting Methods
可以通过对.FxCop文件添加规则来实现
1: <FxCopProject Version="10.0" Name="My FxCop Project">
2: <Rules>
3: <RuleFiles>
4: <RuleFile Name="$(ProjectDir)/../Rules/DataflowRules.dll" Enabled="True" AllRulesEnabled="True" AllRulesBreakBuild="True" />
5: </RuleFiles>
6: </Rules>
7: </FxCopProject>
DataflowRules.dll文件可以在%Program Files%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\Rules中找到,XML的路径可以自己视情况添加
Reference:
http://msdn.microsoft.com/zh-cn/library/bb429449(v=vs.80).aspx