This chapter demonstrated the need for static analysis tools, introducing you to the .NET Framework Design Guidelines for Class Library Developers. These guidelines are a very important resource that Microsoft has made freely available and which are the basis for Team System's included Code Analysis rules.
We described the Managed Code Analysis tool, including how it now integrates with Visual Studio Team System and enables rule analysis to be performed with a simple build. You learned how to configure and execute analysis and how to work with the resulting rule violation messages.
To support projects using a repeatable build process or that need additional flexibility, you learned how to use the command-line Managed Code Analysis tool, and how to create FxCopCmd project files to store settings.
Finally, you walked through the process of creating your own rule and integrating it with your analysis process. You created the simple AvoidExposingPublicConstants rule as an example of how to use the new introspection engine to create new Managed Code Analysis rules in Team System.
In the next chapter, we introduce the Unmanaged Code Analysis tool. It is similar in purpose to the one described in this chapter, but is instead used for static analysis of native code.