Search code examples
c#visual-studiocpu-usagevisual-studio-2022

Visual Studio 2022 CPU Usage frozen at preparing data step


I am trying to look at CPU usage with Visual Studio 2022, and I have done this before in Visual Studio 2017 without any issue, but in 2022 so far it has always gotten stuck at the preparing data step. When I hit a break point I get this view

Preparing data.

I've tried simplifying my program to make sure there isn't something weird in my code causing problems, but I get that same window just infinitely spinning in circles when I tried to profile this code

var counter = 0;
for(var i = 0; i < 999; i++)
{
    counter += i;
}
Console.WriteLine(counter);

I've had issues with this in a .net 6.0 console app, and a wpf app targeting 4.7.2

This is my Visual Studio info

Microsoft Visual Studio Professional 2022 Version 17.0.5 VisualStudio.17.Release/17.0.5+32112.339 Microsoft .NET Framework Version 4.8.04084

Installed Version: Professional


Solution

  • This is potentially something that was broken in 17.0.5, usually there is a yellow flag notifying if an update is available, but when I manually checked for an update I found I could update to 17.1.1

    After updating to 17.1.1 the CPU usage feature is working as expected.