-->

FxCop for .NET 4.0

2019-02-03 23:14发布

问题:

I know Visual Studio 2010 has a new Code Analysis tool built in, but that is only for the premium and ultimate editions. From what I can see the latest FxCop supports .NET 3.5 SP1. Searching I wasn't able to find any references to an FxCop for .NET 4.0. Is there plans to continue to offer FxCop and for it to support .NET 4.0? Where would I find more information about it and download it?

回答1:

The latest version of FXCop (v10) is bundled with the install of the latest Windows SDK for Windows 7 and .Net 4, released on 5/19/2010. From Microsoft - Full ISOs

Once the SDK is installed you can find the FXCop installer EXE under %programfiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop (This assumes you kept the default install directory when installing the SDK).

Enjoy.



回答2:

FxCop is now enhanced to work with .NET 4.0. You can find it here: http://blogs.msdn.com/b/codeanalysis/archive/2010/07/26/fxcop-10-0-is-available.aspx

New version is marked with 10.0 just like Visual Studio.



回答3:

I googled for FXcop 4.0 and found the following a helpful links:

http://social.msdn.microsoft.com/Forums/en/vstscode/thread/74b2815a-626d-4aef-a08a-14c2fa72b506

Looks like its not yet out but FXCop support for .NET 4.0 is planned.



回答4:

An alternative to FxCop rules would be to use the tool NDepend. This tool that lets write Code Rules over C# LINQ Queries what we call CQLinq, supports .NET v4 and v4.5, and is integrated in VS 2012, 2010, 2008. Disclaimer: I am one of the developers of the tool

More than 200 code rules are proposed by default. Customizing existing rules or creating your own rules is straightforward thanks to the C# LINQ syntax.

Rules can be verified live in Visual Studio and at Build Process time, in a generated HTML+javascript report.