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?
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?
In Visual Studio 2022, I've resolved it by disabling these two checks:
after that, Visual Studio works well.
Run background code analysis for:
to None
so it's essentially disabled I assume. I'll have to toggle this back on on each update to see if this has been fixed. –
Cordie 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
This has apparently been fixed in VS2022 v17.3
© 2022 - 2024 — McMap. All rights reserved.