vs 2022:Roslyn代码分析的高RAM和CPU问题

发布于 2025-02-07 12:07:07 字数 269 浏览 2 评论 0 原文

我们在Visual Studio 2022(V.17.2.2 64bit)中有一个巨大的解决方案(ASP.NET MVC,C#)。

Roslyn代码分析始终使用高CPU和RAM。 有没有办法防止这个问题?配置还是其他?

We have a huge solution (ASP.NET MVC, C#) in Visual Studio 2022 (v.17.2.2 64bit).

Roslyn Code Analysis is always using high CPU and RAM.
Is there a way to prevent this issue? A configuration or something else?

Task manager

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

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

发布评论

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

评论(3

美人如玉 2025-02-14 12:07:07

在Visual Studio 2022中,我通过禁用这两项检查来解决它:

“在此处输入图像说明”

之后,Visual Studio效果很好。

In Visual Studio 2022, I've resolved it by disabling these two checks:

enter image description here

after that, Visual Studio works well.

和我恋爱吧 2025-02-14 12:07:07

它仍在VS2022 v17.6中进行,

我只能通过从解决方案文件夹中暂时删除我的 .editorConfig 文件来修复它(并重新启动VS)。

这意味着问题是我在 .editorConfig 中打开的一些分析器,在某些情况下需要很长时间才能运行。为了弄清楚哪个是造成问题的,我想我必须全部关闭它们,然后一次重新打开一个,看看问题又回来了,但是我没有时间去尝试一下。

编辑:我遵循说明打开构建过程的分析和记录,然后查看日志以查看哪些分析仪花费最多的时间。我禁用了这些分析仪,似乎对一些分析仪有所帮助。

编辑:一位花费很长时间的分析仪无法关闭,事实证明是 bug

It's still happening in VS2022 v17.6

I've only been able to fix it by temporarily deleting my .editorconfig file from the solution folder (and restarting VS).

This implies that the problem is some analyzer that I've turned on in .editorconfig that takes a really long time to run under some circumstances. In order to figure out which one is causing the problem I guess I'd have to turn them all off and then turn then back on one at a time to see at which point the problem came back, but I haven't had time to try that.

EDIT: I followed the instructions here to turn on analysis and logging of the build process, and then viewing the log to see which analyzers were taking the most time. I disabled those analyzers and it seems to have helped some.

EDIT: One of the analyzers that was taking a long time couldn't be turned off and it turned out to be a bug

我不是你的备胎 2025-02-14 12:07:07

显然,这已经解决了VS2022 V17.3

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