. Net programmers ten essential tools-fxcop

Source: Internet
Author: User
Fxcop

The. NET Framework is very powerful, which means there is a great possibility of creating excellent applications, but there is also the possibility of creating inferior programs. Fxcop is one of the tools that help you create better applications. It uses the following methods: enables you to analyze the Assembly and use different rules to check whether it complies with these rules. Fxcop is accompanied by a fixed number of rules created by Microsoft, but you can also create and include your own rules. For example, if you decide that all classes should have a default constructor without any parameters, you can write a rule to ensure that each class of the Assembly has a constructor. In this way, no matter who writes the code, you will get a certain degree of consistency. For more information about creating custom rules, see the bugslayer topic for John Robbins (Msdn?MagazinePublished in June 2004 ).

So let's take a look at the actually running fxcop and see what errors it has found in the nunitexample program I 've been working on. When you open fxcop, you first need to create a fxcop project and then add the assembly to be tested. After the Assembly is added to the project, you can press analyze and fxcop will analyze the assembly. Displays the errors and warnings found in the set.

Fxcop found several problems in my program set. You can double-click an error to view details, including the rule description and where to find more information. (One interesting thing you can do is to run fxcop on the Framework Assembly and view what happened .)

Fxcop can help you create better and more consistent code, but it cannot compensate for poor application design or very simple and poor programming. Fxcop cannot replace peer-to-peer code check, but because it can capture a large number of errors before code check, you can spend more time solving serious problems without worrying about naming conventions.

Fxcop is developed by Microsoft and can be downloaded from the http://www.gotdotnet.com/team/fxcop.

Go to the. NET programmer's ten essential tools-directory

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.