Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

VS on 100% CPU for several seconds on each build when NCrunch is disabled
ndeslandes
#1 Posted : Wednesday, November 26, 2025 10:15:55 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/12/2014(UTC)
Posts: 12
Location: United Kingdom

Thanks: 2 times
Was thanked: 3 time(s) in 2 post(s)
A strange one I've been battling for the last few weeks. Applies to VS2022 or VS2026

I noticed that for a tiny number of solutions, Visual Studio would completely freeze for 5-10s whenever a new build action was kicked off for the solution; including something as simple as "Clean" repeatedly.
The size of the project didn't matter, even a single C# file console app would trigger it.

I didn't suspect NCrunch at the time, assuming something what wrong with our VDI environment or graphics drivers.

I finally isolated the problematic use case yesterday. This happens only when:

  • NCrunch is installed
  • But disabled for the solution


Here's the full detail of my setup and investigation using WPA:

Environment
Visual Studio: VS2022/2026
.NET SDK: .NET 9
NCrunch: 5.20.0.2
OS: Windows 11
Running on: VDI with NVIDIA GPU drivers
Hardware acceleration: Disabled/Enabled (no effect)

Steps to Reproduce
Install NCrunch in Visual Studio.
Open a .NET 9 C# solution.
Disable NCrunch for the solution.
Start a build or clean.
Result:

One CPU core is pegged at 100%.
The Visual Studio UI freezes for 5-10s before the build starts.
No disk or network activity.
Enabling NCrunch for the solution or uninstalling it completely prevents the issue.

Trace Details
Hot thread stack (from WPA):

Code:

Stack,Count,Weight (in view) (ms),TimeStamp (s),% Weight
| Microsoft.Build.ni.dll!Microsoft.Build.BackEnd.Logging.LoggingService.WaitForLoggingToProcessEvents(),4523,"4,516.181839",,11.29
| |- mscorlib.ni.dll!System.Threading.WaitHandle.WaitOne(Int32, Boolean)",4426,"4,419.303839",,11.04
| | |- mscorlib.ni.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)",4416,"4,409.316539",,11.02
| | | |- clr.dll!WaitHandleNative::CorWaitOneNative,4385,"4,378.354939",,10.94
| | | | |- clr.dll!Thread::DoAppropriateWait,4189,"4,182.607739",,10.45
| | | | | |- clr.dll!Thread::DoAppropriateWaitWorker,4173,"4,166.630339",,10.41
| | | | | | |- clr.dll!Thread::DoSyncContextWait,4106,"4,099.717239",,10.25
| | | | | | | |- clr.dll!MethodDescCallSite::CallTargetWorker,3151,"3,145.902139",,7.86
| | | | | | | | |- clr.dll!CallDescrWorkerWithHandler,2790,"2,785.351239",,6.96
| | | | | | | | | |- clr.dll!CallDescrWorkerInternal,2763,"2,758.386639",,6.89
| | | | | | | | | | |- WindowsBase.ni.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait(IntPtr[], Boolean, Int32)",2723,"2,718.436139",,6.79
| | | | | | | | | | | |- clr.dll!SynchronizationContextNative::WaitHelper,2711,"2,706.451639",,6.76
| | | | | | | | | | | | |- clr.dll!Thread::DoAppropriateWait,2630,"2,625.550939",,6.56
| | | | | | | | | | | | | |- clr.dll!Thread::DoAppropriateWaitWorker,2618,"2,613.567439",,6.53
| | | | | | | | | | | | | | |- clr.dll!MsgWaitHelper,2451,"2,446.772239",,6.11
| | | | | | | | | | | | | | | |- VsLog.dll!<PDB not found>,2364,"2,359.881539",,5.90
| | | | | | | | | | | | | | | | |- combase.dll!<PDB not found>,2113,"2,109.212739",,5.27
| | | | | | | | | | | | | | | | | |- combase.dll!<PDB not found>,2105,"2,101.223339",,5.25
| | | | | | | | | | | | | | | | | | |- combase.dll!<PDB not found>,2084,"2,080.250339",,5.20
| | | | | | | | | | | | | | | | | | | |- KernelBase.dll!WaitForMultipleObjectsEx,1931,"1,927.446639",,4.82
| | | | | | | | | | | | | | | | | | | | |- ntdll.dll!ZwWaitForMultipleObjects,1747,"1,744.619493",,4.36


The UI Thread spins continuously in WaitForMultipleObjectsEx while processing what seems to be a huge number of events from VsLog.dll.
No I/O activity during the spike.


Notes
Occurs only when NCrunch is installed but disabled for the solution.
Enabling NCrunch or uninstalling it eliminates the problem.
Environment variables such as VSTelemetryOptOut=1 and VSLOGGINGOPTOUT=1 have no effect.
Remco
#2 Posted : Wednesday, November 26, 2025 11:21:10 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,427

Thanks: 1008 times
Was thanked: 1353 time(s) in 1256 post(s)
Hi, thanks for sharing this.

There isn't really much of NCrunch that is active when it's disabled. However, it's definitely worth checking the logging situation.

Can you check to see if NCrunch is set to 'Log to output window' in its configuration? If so, turn this off. Also make sure that 'Log Verbosity' is set to 'Summary'.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.125 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download