博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Fxcop使用笔记

Posted on 2008-05-08 16:33  qqhe325  阅读(5272)  评论(2编辑  收藏  举报
1.利用fxcop生成项目的SolutionAnalysis.FxCop项目,并放在和生成.dll,.exe相同的目录中
    obj\Debug\
2.添加外部工具
   
3.运行

4.在输出窗口,双击提示可以看到代码

5.用户规则注意嵌入资源和类在同一个命名空间下,删掉AssemblyInfo.cs,把生成的dll放到Rules目录中即可
6.由于命令行工具不能生成.fxcop项目和使用用户规则,所以用户规则可以在fxcop中再使用
7.The FXCop command-line interface (version 1.32 RC) does not support the following capabilities:
  • Creation of a new FXCop project.
  • Modifications of existing FXCop project files to include/exclude rules (not applicable).
  • Add/Remove target assemblies from a project file.
  • Add custom project rules to a project.

Hence, developers cannot configure an FXCop project from within the VS.NET IDE; they need to use the FXCop GUI to make any changes to the project file.

links:
定制FxCop规则示例之一:AvoidICloneableImplementation
http://www.iocblog.net/static/2007/414.html

使用FxCop做代码检查和优化
http://www.cnblogs.com/jchdong/archive/2007/03/14/669610.html
FXCop Integration into VS.NET
http://www.codeproject.com/KB/dotnet/FxCopIntegrateVSNET.aspx
MSBuild with Cruise Control .NET
http://geekswithblogs.net/michelotti/archive/2007/02/23/107164.aspx
Custom FXCop Rules
http://www.projectdistributor.net/projects/Project.aspx?projectId=136
How to debug FxCop custom rules

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=85417&SiteID=1