Build 'Consistent' .NET assemblies with FxCop

The term 'best practices' sends chills up the spines of many people. Reason being, what is 'best' for one is 'horrible' for another. However, if you are interested in ensuring that your custom .NET assemblies are in-sync with the coding guidelines proposed by Microsoft, you will want to obtain a freely downloadable tool named fxcop.exe (FxCop may be downloaded from https://www.gotdotnet.com/team/fxcop/).

This tool allows you to load any .NET binary and run it though a battery of tests which will check how your assembly stacks up against the coding standards upheld in the Base Class Libraries (including numerous .NET 'best practices'). Even better, you can create custom rules and ignore those you don't care about. This Windows Forms application is quite intuitive, however be aware that fxcop.exe ships with the requisite online help.


Tip from Andrew Troelsen
Posted by: Duncan Mackenzie, MSDN
This post applies to Visual C# .NET 2003