debug custom code-analysis rules  
Author Message
mahendra_nath





PostPosted: Visual Studio Code Analysis and Code Metrics, debug custom code-analysis rules Top

Is there a way to debug custom rules in vs2005 without using the stand-alone fxcop

Thanks a lot,

Mahendra.



Visual Studio Team System12  
 
 
David M. Kean - MSFT





PostPosted: Visual Studio Code Analysis and Code Metrics, debug custom code-analysis rules Top

You can simply call the c:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe directly rather than go through Visual Studio.

In your project properties, choose the Debug tab and add it as a external program and Visual Studio will hook onto to it automatically.



 
 
mahendra_nath





PostPosted: Visual Studio Code Analysis and Code Metrics, debug custom code-analysis rules Top

Hi David,

Let me explain you the way I have my projects set up -

1. A Custom rules project which has references to the following dll's under 'C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop' folder - FxCopSdk.dll, Microsoft.Cci.dll.

2. A test project on which I want to run code analysis on.

3. Copy the custom rules assembly to the 'C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\Rules' folder.

4. I check the project properties of the test project and I see the new rule in the code analysis section.

5. I run code analysis on this project and I see all the warnings.

Now, I would like to debug the custom rules project, I mean i would like to step into the 'Check' method.

I tried using fxcopcmd.exe but I am not able to get it to work. I would appreciate if you can explain the procedure in detail.

Thanks a lot.


 
 
David M. Kean - MSFT





PostPosted: Visual Studio Code Analysis and Code Metrics, debug custom code-analysis rules Top

Based on a later reply over here: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1090172&SiteID=1, I will take it that you solved this problem.