如何告诉 Visual Studio 不要多次显示相同的警告?

发布于 2024-12-13 06:35:34 字数 371 浏览 0 评论 0原文

几周前,我开始注意到我的 VS 显示了一些警告两次。两个显示的警告位于同一行/列。它与错误列表中显示两次的警告完全相同。

例如:

我在代码中添加了以下行,这样我就不会忘记它,因为整个解决方案有相当多的 TODO 标记:

#warning TODO: Refactoring needed

当我点击“重建解决方案”时,VS 最终显示相同的警告两次。一次是警告 1,再次是警告 10。

我尝试将 VS 设置恢复为默认设置,并且还重新安装了 VS。警告仍然显示两次。

我还没有找到任何解决方案,我想也许我可以问问是否有人以前见过这个问题。也许有人可以告诉我如何解决这个问题,因为它开始让我感到非常不安。

A few weeks ago I started noticing that my VS displays some warnings twice. Same Line/Column for both displayed warnings. It's exactly the same warning which is displayed twice within the Error List.

For example:

I've added the following line within my code such that I don't forget it because the whole solution has quite a few TODO marks:

#warning TODO: Refactoring needed

When I hit "Rebuild solution" VS ends up displaying the same warning twice. Once as warning 1 and again as number 10.

I've tried reverting VS settings to default and I've also reinstalled VS. Still the warning is displayed twice.

I haven't found any solution yet and I thought maybe I ask if someone has seen this problem before. Maybe someone can tell me how to resolve this problem since it start to really upset me.

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

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

发布评论

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

评论(1

是伱的 2024-12-20 06:35:34

该代码被编译多次。每一次传递都会产生该警告,就像每一次传递都会产生一些代码一样。检查您实际上没有多个同名文件或通过另一个项目中的链接引用的同一文件。

The code is being compiled more than once. Each pass is going to produce that warning, just as each pass produces some code. Check that you don't actually have multiple files with the same name or the same file referenced via link in another project.

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