FxCop 在 VB.NET 上与在 C# 上一样有价值

发布于 2024-07-15 10:23:43 字数 260 浏览 3 评论 0原文

我一直在使用 FxCop 查看一些 VB.NET dll,所有错误都与 DLL 设置(即强名称、文化信息)和变量方法的情况有关。

查看 FxCop 检查 C# Dll 的几个示例,它似乎提供了更多潜在错误。

这是否意味着 FxCop 在 C# 开发上比 VB.NET 更有价值,或者我只是选择了不好的例子。

我认为 FxCop 是在 IL 上工作而不是在特定语言上工作,所以我只是缺少 VB.NET 的规则文件还是有更多可用于 C# 的规则文件?

I have been looking at a few of our VB.NET dll's using FxCop and all of the errors relate to DLL setup (i.e. Strong Names, Culture Info) and the case of Variables methods.

Looking at a few examples of FxCop examining a C# Dll, it appears to offer a lot more potential errors.

Does this mean that FxCop is more valuable on C# developments that VB.NET or have I just chosen bad examples.

I thought it was the case that FxCop worked on IL rather than the specific languages, so am I just missing rules files for VB.NET or are there more available for C#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

平生欢 2024-07-22 10:23:43

我想说这是不正确的。 FxCop 对于任何 .NET 开发人员来说都是无价的。

您需要展示一个示例,说明一段 VB.NET 代码与一段 C# 代码相比,您从 FxCop 获得更多(或更少)的输出,两者都编译为相同的 IL。

I would say that's not correct. FxCop is invaluable to any .NET developer.

You need to show an example of where you get more (or less) output from FxCop for a piece of VB.NET code, versus a piece of C# code, both of which compile to the same IL.

古镇旧梦 2024-07-22 10:23:43

据我所知,FxCop 与语言无关。 更有可能的是,C# 在各个领域比 VB.NET 拥有更多的自由度,从而允许发生更多错误(正如 FxCop 所解释的那样),而不是 FxCop 存在某种偏见。 如果是这种情况,那么我可以看到它对 C# 开发人员比 VB.NET 开发人员更有价值,因为前一种语言有更大的范围来创建 FxCop 可以检测到的问题。

然而,FxCop 对于任何 .NET 项目来说都是一个非常宝贵的工具,即使某些语言使得更难犯错误。

As far as I am aware, FxCop is language agnostic. It is more likely that C# has more freedom than VB.NET in various areas allowing for more mistakes to occur (as FxCop interprets it) rather than FxCop being biased somehow. If this is the case, then I can see it being more valuable to a C# developer than a VB.NET developer as the former language has more scope for creating issues that FxCop can detect.

However, FxCop is an invaluable tool for any .NET project, even if some languages make it harder to make mistakes.

梦里寻她 2024-07-22 10:23:43

FxCop 应该适用于编译代码,因此您编写的语言并不重要。 我已经在使用 C# 或 VB 的项目中使用过该工具,因此它确实有效。 实际上,这很有帮助。

FxCop is supposed to work on compiled code, so the language you write in shouldn't matter. I've used the tool on projects with either C# or VB, so it does indeed work. It has been rather helpful, actually.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文