. NET development programmer Prerequisites--FXCOP: Monitoring Code Tools

Source: Internet
Author: User
The. NET framework is very powerful, which means it is highly likely to create good applications, but there is also the possibility of creating inferior programs. FxCop is one of the tools that help create better applications by analyzing assemblies and using many different rules to check whether it conforms to these rules. FxCop is accompanied by a set of rules created by Microsoft, and you can create and include your own rules. For example, if you decide that all classes should have a default constructor with no arguments, you can write a rule to make sure that there is a constructor on each class of the assembly. This way, no matter who writes the code, you get a certain degree of consistency. If you need more information about creating custom rules, see John Robbins's Bugslayer column on this.

So, let's take a look at the actual running FxCop and see what bugs it finds in the Nunitexample assembly I'm developing. When you open FxCop, you first need to create a FXCOP project, and then add the assembly you want to test. After you add the assembly to the project, you can press ANALYZE,FXCOP to parse the assembly. Figure 6 shows the errors and warnings that FxCop found in the assembly.

Figure 6 FxCop Run Screen

FxCop found a couple of problems in my program set. You can double-click an error to see the details, including the rule description and where to find more information. (One of the interesting things you can do is run FxCop on the frame assembly and see what's going on.) )

FxCop can help you create better, more consistent code, but it doesn't compensate for poor application design or very simple and clumsy programming. FxCop is also not a substitute for peer code checking, but because it can catch a lot of errors before the code is checked, you can spend more time solving serious problems without having to worry about naming conventions. FxCop developed by Microsoft, download address is: HTTP://WWW.GOTDOTNET.COM/TEAM/FXCOP



</

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.