What is making Visual Studio hang and how can I prevent it? - visual-studio-2010

I'm working on a solution in Visual Studio (v10.0.30319.1) which contains 8 C# projects (WPF Application and Class Libraries). I've been working on this solution for several months, but yesterday I started having problems with Visual Studio hanging for some time when starting and stopping my app in the debug environment.
I first notice it when I stop the application and VS hangs for around 5 seconds. I then press F5 to start again and it takes 5-10 seconds to start. Then I stop the application and it takes about 10 seconds to stop. The problem subsequently worsens until I reboot the computer (I'm not sure if restarting VS is sufficient - I will test and update the question when it happens again).
Once the computer has been restarted, I cannot replicate the problem, but I know it will creep up on me again today.
While the problem is happening, one of the cores is at 100% usage. Memory usage for devenv.exe is normal at a bit over 200MB, and not increasing.
The computer is quite powerful and everything else is working correctly so I'm sure it's not a resource issue.

Did you update VS2010 with Service Pack 1?
Microsoft Visual Studio 2010 Service Pack 1 Download
Be warned, although the page says it's only an 800 KB download, what is actually downloaded is a downloader that downloads over 800 MB of patches. (That's a lot of "downloads" :P)

Delete your solution user option files i.e. {SolutionName}.suo and {SolutionName}.docstates.suo
It worked for me, before doing that I tried #Casey solution but it didn't work.
so first try deleting files, if it do not work then update VS2010 and then delete files again.

Related

Visual Studio slowness, possible reason?

Im struggling with extremely slow Visual Studio. I use it to build C++ projects mostly.
Everything could be super slow. Menu's loading, intelIsense tips, builds. I've just tested building simple solution in 1 file, and build took around 5 minutes. But! I found this article about Windows Performance Analyzer which I used to trace this solution build. Despite overall time taking around 5 minutes, WPA report build took only around 0.686 seconds, attaching screenshot:
apparently I press "rebuild" in VS and build itself started ~300 seconds later(timeline).
Currently I use VS2019. Same problem I observed on VS2017. I did removed all VS components and installed VS2019 and problem is not gone. All other programs run fine. No excessive CPU load(intell 6700k), no noticeable harddrive usage(windows and VS components are on m2 ssd, lightning fast), 32 gb ram and enough free space on system disk.
Only VS extension I installed myself is QT extension for VS2019. Which actions can I take next to find the problem?
Things to try:
devenv /safemode from a command line starts the IDE in safe-mode with all plugins disabled.
Visual Studio Installer and repair install
Disable graphics acceleration in Visual Studio (Tools|Options|General ... there are a few "rich client visual experience" related things)
Check paths on your computer. If other apps run fine but one does not, it could be that this app tries to access a network drive or website which is not available.
Run "procmon" and "procexp" (Process Monitor/Process Explorer from Sysinternals) and take a look at what's going on.
Try VS 2022.

why is my Visual Studio 2019 Pro so slow debugging, after doing Visual Installer update?

VS2019 was working fine.
Then I ran Visual Installer and added "Mobile development with .NET".
After than, visual Installer "update" button was showing, so I did the update.
But now when I stop my VS2019 project at a breakpoint, single stepping is very slow, taking many seconds per step.
Tried restarting VS2019, and restarting my Windows 10 Pro, but got same slowness.
Opened same project with VS2017, it is debugging is OK, no slowness.
The resolution I found was that the culprit is not Internet, RAM, or CPU.
It is the Disk Usage. Check for your disk usage under the Performance tab in Task Manager. Try and find out which process (Anti-Malware/ anti-virus/ant other process) is eating up your resources.
Kill the culprit and it works smooth. For me, it was Disk Scan Service and Windows Search Service (which is fairly useless).
Check this link to kill the Windows search service.
Comprehensive deletion of all contents of %TEMP% worked for me -
https://developercommunity.visualstudio.com/content/problem/516141/very-hight-cpu-usage-by-visual-studio-2019.html
I can't believe is 2020 and MS can't stop spaffing crap into a temp directory which causes their software to slow to a snails pace with some kind of infinite processing issue. Jeez.
For me it was NVidia NSight for visual studio. Uninstalling it from the windows application list was the only option as it wasn't showing up in the VS2019 Extensions manager.
For me it turned out to be a problem with the installation. I had old versions of Visual Studio and .NET libraries still on my machine. I did a full uninstall of Visual Studio, .NET Core SDK, .NET Framework, etc. and then re-installed Visual Studio 2019 and just the .NET libraries that I needed. After that VS 2019 debugging is speedy.
I was experiencing the same issue stepping over one line of code took me 1400 ms on my VM and 6 ms on my coworker's VM. (Earlier this week he had copied my VM so essentially we were on the same machine).
Took me some time but then I remembered a change I did to my visual studio.
Earlier that week I needed to step into one of our DLLs. To do this I changed my debug settings under Project Properties --> Debug --> Debugger engines. I Checked "Enable native code debugging". This was wonderful to allow me to debug into our DLL and see what was happening on the other side, although it dramatically slowed down my debugging (233x slower to be exact!!!!).
The performance change will different per your solution and how much you are inheriting, but unchecking this did the fix for me!
Delete .vs folder where locate in your project root directory after backup.

Visual Studio 2013/2015 Idle CPU usage

I'm currently evaluating Visual Studio 2015 RC. I've noticed when running the IDE, The Visual Studio 2015 process is constantly at around 25% CPU usage. Even without a project loaded and without the welcome page it is gobbling up 25% CPU usage at a constant rate. No other applications running other than background services. All other running processes use around an additional 2 to 4 percent CPU overall.
This behavior has also been noticed in Visual Studio 2013.
Is anyone else seeing this behavior? Is this normal? Any suggestions?
Had this same problem. Processor constantly at 45-50% even when the IDE is completely idle.
Turns out the problem is the Microsoft Git Source Code provider.
I turned that off and processor dropped to 0 and the IDE became much more usable.
In my case disabling Telerik ASP.NET MVC Extension solved high CPU issue.
High CPU load started on solution load and didn't drop (40% with one, 80% with two solutions) until VS was closed or even sometimes after (had to kill the process).
Tools->Extensions and Updates->Installed, find the extension and click 'Disable'.
In my case all reference counts tried to update every time when I edit code.
I have just turned them off. You can do it this way.
It’s not to be expected that Visual Studio should chew up continuous CPU time.
I am running Visual Studio 2015 Community RTM right now with a medium sized project open, and am not seeing any ongoing CPU usage (according to Process Hacker 2, which shows usage as small as 0.01 percent). It’s just blank, which means not even 0.01% CPU usage is registering.
Keep in mind that IntelliSense scans your project files in the background to build the database for popping up its suggestions, etc.
Choosing Project > Rescan Solution from the menus will result in that process being done over, which will cause the CPU to be used for a time. But it should ultimately go quiet.
Seemingly forever, there have been times when deleting the Intellisense Database files and doing a full rescan solves “odd behavior” type problems. I don’t know if it’s the “prescribed” method, but if I suspect an IntelliSense problem I just delete the .sdf file in the project folder if I want to make sure Visual Studio starts with a clean slate. This isn’t necessary very often.
I also had this problem, constant 20-40% CPU when idling (Visual Studio 2015 update 1). I noticed that other local repositories of the same code did not have this problem.
I deleted the problematic local repository and took a new checkout, this solved the issue for me. Why this worked, I unfortunately cannot explain...
I run resharper, turned that off and turned off the Microsoft Git provider and still had high CPU issues, devenv.exe would also run after close... until recently.
It appears VS 2015 Update 2 has resolved these issues!
https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx
In my case; "Visual Studio 2015 Update 1" gone crazy editing JS files regarless of the length of the source. It used high CPU and the editor is even freezed. I fixed the issue by disabling the 3rd party add-ons by one-by-to detect the buggy one causing VS 2015 malfunctioning.
Hope it works.
In my case, the culprit was Node.js tools for Visual Studio. I had v1.1.2 installed and the cpu was constantly around 25-40%.
A switch to Node.js Tools v1.2 RC resolved the problem completely after an initial high load that went away in a couple of minutes.
In my case it was either the Roaming Extention Manager or most probably the azure worker role project in my solution. If you have one of these try unloading it and restart visual studio. I can reproduce it but I don't know why it happens.
I've noticed also that when running and stopping a debug episode on the local server, if the page is still open in the browser, VS will continue to run at high CPU. Closing the browser page stops this.
I want to share my experience,
In my case I had to diable all extensions and updates and code analysis c#.
1-For extensions and updates :
Tools => Extensions and updates
2-For the code analysis
Solution explorer => right click on the project => Properties =>Click on the tab "Code analysis" => click on the "Open" bouton => Uncheck the checkbox "Microsoft.CodeAnalysis.CSharp" => save and exit.
Cpu usage descended to 1 %.
In my case, The .suo file in Visual Studio was the culprit. Deleting it fixed my issue.
Refer below link for more details.
https://shemeerns.com/2014/04/04/the-solution-user-options-suo-file-in-visual-studio/

Visual Studio 2013 freezes when ending debugging

Out of the blue Visual Studio started locking up on me for 2-5 minutes at a time when ending debugging (after a test run, in my case). CPU usage is high (maxing out one core). If I leave it, eventually it will unfreeze and continue as normal.
I've tried a number of solutions but nothing seems to help.
I don't have any add-ons installed
I tried restarting Visual Studio and my PC
I rebooted my PC and ran chkdsk /F
I don't have Show All Files turned on in the Solution Explorer
Turned out to be stupidly simple: I saw a suggestion somewhere (can't remember where, sorry) to clear all breakpoints with Ctrl+Shift+F9. I did that and restarted the IDE for good measure, and so far it's been running fine.

Visual Studio takes forever to start the first time

I downloaded and installed Visual Studio 2013 Profession Trial on my Windows 7 64-bit computer ( RAM is 6 GB). But, when I start it for the first time, it says 'We're getting things ready. Thanks for your patience' and its been on for about an hour.
Is this normal with VS 2013?
EDIT 1:
I left my computer running the whole night, and by morning it had re-booted. After the re-boot, VS 2013 seems to be starting quickly. So, its hard to say why Visual Studio 2013 was taking hours to start up the first time.
If the loading is taking a long time, Alt+Tab to find a login page hidden underneath the "We're getting things ready" window. Enter your Microsoft account credentials.
This answer was originally posted by Alex K in a comment.
I had already gone past the credentials screen.
I left mine running for a while but eventually killed the process and restarted VS.
It started instantly.
I had no sign-on screen hiding behind the "We're Getting Things Ready". I ended the task in Windows Task Manager. Then I started Visual Studio again (no need to reboot). This time I noticed the option to "Sign In later". I selected this and it started up in just a couple of minutes. I then signed in after it started up. All seems to be working fine now.
I too experienced this odd first time start up 'hang' on a fresh install to a new PC. For what it's worth, my experience mirrored bassbytesbikes. I finally just killed and restarted it. No discernible ill effect... so far.
I came across this problem installing Visual Studio Premium 2013 in a VirtualBox VM. Specifically, I'd enter my login credentials and then it would hang on the 'Preparing for first time use' screen. If I killed VS and then restarted it, it'd bring up the main window but then hang before it displayed the startup page.
The solution for me was to enable 3D graphics acceleration in the VM settings. This seems to be because IE relies on 3D graphics and VS uses IE to display the start page (among other things).
As an answer, I got the same issue while creating, openning projects at visual studio 2012. Then I searched a lot about it and I learned that they fixed that problem with Visual Studio 2013 with Update 5. I got the vs2013 with update 5 and everything works well now.
For my situation the firewall was blocking the connection to Microsoft's server

Resources