Similar to stylecop, fxcop and stylecop are used to constrain our encoding specifications. For the differences between them and the code analysis provided by Vs, refer to the blog post on debuglzq.
The installation process is very simple. You can download the installation files of the two policemen from the Internet and install them according to the default settings.
After stylecop is installed, you can right-click and use it in the VS solution or any location of a single file. It has been integrated into vs by default. As shown in.
After fxcop is installed, it is not inherited to vs by default. After the installation is complete, it is as follows:
Of course, we can run this "traffic light" to create a new fxcop project, and then load the corresponding project (Compiled EXE, DLL, etc.). Analyze is as follows:
It is better to integrate fxcop into vs, which is also a problem to be explained in this blog post, because debuglzq encountered the same problem during its own settings, therefore, write it out for reference by bloggers who encounter the same problem.
On the vs interface, Click Tools> external tools and add one. As follows:
The relevant information to be filled in is shown in the above interface, the content is:
- Title (name, any ):Run Fxcop
- Command(path of fxcopcmd.exe ):C: \ Program Files \ microsoft fxcop 1.36 \ fxcopcmd.exe
- Arguments (the debuglzq does not understand the meaning of each field when running some fxcop configurations./Note R: You can add custom rules to this Rules path ):/C/F: $ (targetpath)/D: $ (bindir)/R: "C: \ Program Files \ microsoft fxcop 1.36 \ rules"
- Initial directory (initialization path, fxcop installation path ):C: \ Program Files \ microsoft fxcop 1.36
This completes the integration of fxcop and Visual Studio.
The tools toolbar has the run fxcop we just added.
Click to run as follows:
OK, so that fxcop is successfully integrated into Visual Studio. Note the setting of the arguments column.
Blog posts do not have any advanced technology. Old birds can bypass and Pat, hoping to help you ~