36

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?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Jim McKeeth
  • 38,225
  • 23
  • 120
  • 194
  • 10
    According to MS; professional developers don't need Code Analysis... http://www.microsoft.com/visualstudio/en-us/products –  Apr 29 '10 at 21:49

4 Answers4

39

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.

GMariakis
  • 544
  • 3
  • 7
  • 6
    Which options did you have to install to get it? It seems the x64 version doesn't install it at all..? – simbolo Oct 09 '11 at 13:08
6

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.

TySu
  • 131
  • 1
  • 3
2

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.

CrimsonX
  • 9,048
  • 9
  • 41
  • 52
  • It has traditionally lagged behind with previous Framework releases, as well. What will be interesting to see is how much of a lag there is with 4.0, because the entire Code Analysis engine has been rewritten from the ground up according to their blog. http://blogs.msdn.com/codeanalysis/archive/2010/04/14/data-flow-analysis-rules-in-visual-studio-2010.aspx – Joseph Ferris Apr 29 '10 at 21:18
  • I had read both of those links. Should have included them in my question. The forum post was in January for Beta 2. I was hoping for something newer. – Jim McKeeth Apr 29 '10 at 21:47
0

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.

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92