C# FAQ: How enforce coding guidelines for custom .NET assemblies
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:FAQs |
| edit |
[edit]
How enforce coding guidlelines for custom .NET assemblies?
Best practices means different things to different developers. But, custom .NET assemblies can be made to conform with the coding guidelines backed by Microsoft using FxCop.
FxCop can load a .NET binary and run a battery of tests against it to determine how the assembly measures up against the Microsoft coding standards. These standards—and best practices—are obeserved in the Base Class Libraries (BCL). FxCop allows custom rules to be created and existing rules to be ignored where desired.
- "FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements. Many of the issues concern violations of the programming and design rules set forth in the Design Guidelines for Class Library Developers, which are the Microsoft guidelines for writing robust and easily maintainable code by using the .NET Framework.
- "FxCop is intended for class library developers. However, anyone creating applications that should comply with the .NET Framework best practices will benefit. FxCop is also useful as an educational tool for people who are new to the .NET Framework or who are unfamiliar with the .NET Framework Design Guidelines.
- "FxCop is designed to be fully integrated into the software development cycle and is distributed as both a fully featured application that has a graphical user interface (FxCop.exe) for interactive work, and a command-line tool (FxCopCmd.exe) suited for use as part of automated build processes or integrated with Microsoft Visual Studio .NET as an external tool."