Issue
Beginning two days ago, dotnet builds became incredibly slow on my development machine. For example, consider this procedure on windows:
Procedure
- md Hello
- cd Hello
- dotnet new console
- dotnet build --no-incremental (this switch is necessary if you want to test multiple builds back to back)
Results
This used to take under a second, but now it takes over 5 seconds.
My laptop was unaffected by the issue yesterday, but today is exhibiting the issue and takes several seconds to build this empty console app.
Here's where it gets really interesting: Inside a virtual machine on my development machine, the procedure runs quickly. 0.87 seconds to compile the empty app. Just like it should.
Something is slowing dotnet.exe down incredibly on my development machine. Visual Studio 2022 is slow, sometimes taking several seconds for a keypress to register. Builds are so CPU-intensive that my mouse cursor stops responding.
This machine is an AMD 5950X with 16 cores and 128 GB RAM. In 2022 that is a very fast machine.
Things I've tried:
- Reboot.
- Uninstall all of dot net (sdks, etc) and Visual Studio 2022 and reinstall the minimum.
- Reinstall visual studio 2022
- Pay close attention to task manager, make sure nothing else is saturating CPU
- Run Sysinternals ProcessMonitor and observe dotnet.exe behavior, and compare it to an unaffected system. There seems to me lots more events on the affected systems but I'm not sure of the significance.
- Use JetBrains dotTrace on an affected an unaffected system and compare.
Help?
How can I determine what is causing the slowness?