visual-studio .NET 4.0 的 FxCop

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2740738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:53:03  来源:igfitidea点击:

FxCop for .NET 4.0

visual-studio-2010visual-studio.net-4.0fxcop

提问by Jim McKeeth

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?

我知道 Visual Studio 2010 内置了一个新的代码分析工具,但这仅适用于高级版和终极版。据我所知最新的 FxCop 支持 .NET 3.5 SP1。搜索我找不到任何对 .NET 4.0 的 FxCop 的引用。是否有计划继续提供 FxCop 并使其支持 .NET 4.0?我在哪里可以找到有关它的更多信息并下载它?

回答by GMariakis

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

最新版本的 FXCop (v10) 与适用于 Windows 7 和 .Net 4 的最新 Windows SDK 的安装捆绑在一起,该 SDK 于 2010 年 5 月 19 日发布。来自 Microsoft -完整的 ISO

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).

安装 SDK 后,您可以在 %programfiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop 下找到 FXCop 安装程序 EXE(假设您在安装 SDK 时保留了默认安装目录)。

Enjoy.

享受。

回答by TySu

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

FxCop 现在得到了增强,可以与 .NET 4.0 一起使用。你可以在这里找到它: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.

新版本与 Visual Studio 一样标有 10.0。

回答by CrimsonX

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

我用谷歌搜索 FXcop 4.0 并找到以下有用的链接:

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

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.

看起来它还没有出来,但 FXCop 对 .NET 4.0 的支持已经计划好了。

回答by Patrick from NDepend team

An alternative to FxCop rules would be to use the tool NDepend. This tool that lets write Code Rules over C# LINQ Querieswhat 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

FxCop 规则的替代方法是使用工具 NDepend。这个工具可以让我们通过 C# LINQ 查询编写代码规则,我们称之为 CQLinq,支持 .NET v4 和 v4.5,并集成在 VS 2012、2010、2008 中。免责声明:我是该工具的开发人员之一

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

超过200分的规则是默认设置的。借助 C# LINQ 语法,自定义现有规则或创建自己的规则非常简单。

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

规则可以在 Visual Studio 中和在构建过程时在生成的 HTML+javascript 报告中进行实时验证。