代码分析工具FxCop 10.0之二:与VS 2008的集成

第一步:打开外部工具引用窗口

 

第二步:添加FxCop工具菜单

 

第三步:设定FxCop工具添加项内容

 

 

运行参数:https://msdn.microsoft.com/en-us/library/bb429449(VS.80).aspx

配置举例:

   VS2008-> Tools -> External Tools  

  Title : FxCop

    Command : D:\Program Files\Microsoft Fxcop 10.0\FxCopCmd.exe 

    Arguments : /c /p:"$(SolutionDir)\$(SolutionFileName).fxcop" /cXsl:"D:\Program Files\Microsoft Fxcop 10.0\Xml\VSConsoleOutput.xsl"

    Initial directory :D:\Program Files\Microsoft Fxcop 10.0

    选择 “Use Output window” 。

运行:Tools ->FxCop

第四步:生成.sln.fxcop文件

打开FxCop GUI界面,可以通过”Add Targets”增加dll 

 

设置Targets以后,可以选定需要的规则:

Important: 

 - Save the project file in the same directory where your solution is. 

 - Project name must be the file name of your solution (including .sln extension).  For example: If your solution file is MySolution.sln, the FxCop project name must be MySolution.sln.FxCop. 

保存后如下图所示:

 

第五步:运行

 

posted @ 2015-12-07 16:06  帅姐  阅读(285)  评论(0编辑  收藏  举报