Is FxCop Dead? Can it be used with VS2015?

2019-04-18 05:21发布

问题:

I was browsing through Stack Overflow and Google for information about automatic coding style practice tools and found FxCop.

But I haven't found recent articles from Microsoft about FxCop. So, I was wondering if FxCop is dead.

Can FxCop be used with Visual Studio 2015? Will it work for enforcing C# design guidelines?

回答1:

FxCop functionality is integrated into Visual Studio 2012 and later versions with VS Code analysis. It covers all FxCop functionality with better integration.

Reference: Code Analysis for Managed Code Overview



回答2:

From this blog (notice written by a Microsoft program manager):

The old version IL-based FxCop/CA are dead but the new version of CA that based on source-code instead of IL will be in VS “14”. (You can scroll down and see the reply from Alex Turner, the owner for Diagnostics in managed languages. )

So yes, it is dead, but replaced with something better. With CA you have an even better tool to do code analysis. Also, with Roslyn, it is quite easy to create your own analyzers.



回答3:

No, not dead, just renamed or reincarnated.

Supplement to CarbineCoder's answer above https://stackoverflow.com/a/36982685/257090

FxCop is now part of all editions of Visual Studio (Community, Pro, Enterprise)

There is a bit of confusion around it, because in the past, Microsoft upcharged for it, you had to buy Visual Studio Premium or Ultimate. As of 2012, as far as I recall, it was made free.



回答4:

FxCop rules have been re-implemented as source based Roslyn analyzers in this open source repo.

See this page for recommended version of NuGet package(s)/VSIX to use to get these analyzers to run during your building/editing experience in Visual Studio.

See this page for further documentation.