Designing .NET Class Libraries: FxCop In Depth

 

FxCop is a tool that enables development teams to check code compliance with best practices. This session will give you a good understanding of the how and why behind the tool.


Notes from FxCop Program Manager Jeffrey Van Gogh...

As previously said in the Designing .NET Class Libraries course, .NET is a fairly new platform with a lot of powerful API’s. In order to enable developers to adopt your component more easily, it is important to give your library the look and feel of the rest of the API’s of the .NET Framework. The whole set of Design Guidelines is fairly extensive, which makes it easy to miss some important guidelines. This is where FxCop can help you.

FxCop is a static analysis tool, meaning that it can perform analysis on your code without actually running your code. It can detect about 250 different issues in your code, of which about 50% are issues around deviating from the Design Guidelines (naming, inheritance, usability, resource management, etc...). The other 50% of issues it can detect are correctness problems around globalization, interoperability (COM/native), performance, portability (32-bit vs 64-bit OS), security and API usage. FxCop is available for free from http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=codeanalysis&ReleaseId=553. FxCop will also be integrated into Visual Studio 2005 Team System which will provide the ease of being able to do all analysis and management from within the IDE, it also provides extra “corporate” rules like code maintainability & reliability.

In our talk, Michael Murray and I first go more in to depth on how FxCop works. We explain what kind of issues it can detect out of the box by showing examples of each category of issue. I give a demo of the new features in FxCop 1.3x. After showing the basic functionality of FxCop, we demo how to add your own rules. Finally we talk about how to integrate FxCop into your development process.

To give FxCop a try, please visit the above link to download it. Any questions related to FxCop can be posted on the FxCop Forum. This forum is monitored by the FxCop Team and an active community of FxCop enthusiasts.

Download The Video

56k 100k 300k