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

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.

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.

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/

"microsoft visual studio preparation" extremely slow

While updating or uninstalling Visual Studio Installer Projects Extension Preview the step "Microsoft Visual Studio Preparation" is taking enormous amount of time. I may say it gets stuck.
My suspicion is the installer (Windows one, not the extension itself, since it is getting modified--updated or uninstalled) is making changes to the registry.
VS registry entries are too many to investigate them one by one. Re-installing VS is not an option. (I have VS 2013 Ultimate on Windows 8.1.)
So, my question is: is there any tool to repair, optimize, clean, or otherwise modify registry (VS portions only) to get the process quicker? Or some sensitive keys that need to be explored? Seems like there are timeouts involved? (Although I do not find this quite reasonable...)
Or, if I am wrong about the registry, Is there another reason for this symptomatic behaviour? UAC issues? NTFS security? Other?
Any advice?
Thanks.
I just solved a similar issue with installing Visual Studio 2013 Update 3. It was taking over an hour on the "Microsoft Visual Studio Preparation" step.
I fired up Process Monitor from Sysinternals and realised the installer was busy logging to C:\FusionLog. Killed the update process, changed the relevant settings under HKLM\Software\Microsoft\Fusion to turn off assembly bind logging, rebooted to make sure the new settings were recognised, and voila, the "Microsoft Visual Studio Preparation" step took on the order of 10's of seconds.
I hope this helps with your problem because this was extremely frustrating for me. I wasted most of my work day on this.
When "Microsoft Visual Studio Preparation" is shown, the installer is running "devenv /setup" to register any packages and templates. That can take a long time. Though it's not ideal, it's not a bug; it's how Visual Studio works.
See this blog posting: http://blogs.msdn.com/b/heaths/archive/2014/01/21/upgrading-visual-studio-2013-update-to-a-newer-update-may-be-slow.aspx
It basically says there's no workaround to save time, just sit tight:
"There is no current workaround that will save time. You might consider starting the upgrade before taking a lunch or heading out for the day."
It also says the issue has been resolved for future versions of VSUpdate and Visual Studio.
Try to block the antivir activity. As for me, it significantly raised the speed.

Visual Studio 2010 (devenv) Hung Process After Closing

I have problem with Visual Studio 2010 on Windows 7 64-bit. After some time of work VS starts consuming ~50% CPU and UI responding slows down. When I close VS then UI disappear but process stay.
When I forgot to kill those hung processes at the end of day, I will end up with numerous devenv.exe processes.
I have reinstall Visual Studio and reinstall Windows and ended up with the same problem... doesn't change anything. Please help. :/
Remove and/or uninstall all third-party Visual Studio add-ins and extensions. Disabling is not good enough.
Visual Studio 2010 relies heavily on graphics. Therefore:
Update your video driver.
Turn off "Enable rich client visual
experience"
Turn off "Use Hardware graphics acceleration if
available"
There are also temporary files that Visual Studio uses that may need to be cleared out.
Clear out your %temp% folder.
Clear out %AppData%\Local\Microsoft\WebsiteCache
Clear out %AppData%\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies
Your project and solution user settings may be corrupt due to so many "crashes".
Delete .user and .suo files (you will lose the startup project, bookmarks, breakpoints, and other user settings specific to projects and solutions.)
Begin where you began before - it may seem overkill but this is the only way to be sure we are addressing everything short of hardware issues.
Reinstall Windows - make sure you are using a validly licensed copy, and patch the hell out of it before installing Visual Studio.
Note: I doubt it is a GPU driver issue, but it never hurts to use the most up to date driver and this is the place to do it right after a fresh OS install.
Install Visual Studio .Net 2010 but do not start it up. Let it get the frameworks installed fresh.
Use Windows Update to install the VS 2010 SP1 patch, and any/all patches for .Net frameworks.
Make an images for yourself right here so you have something to build from if you need to try this again. It will save you lots of time.
Fire up Visual Studio, and test your closing before installing anything else.
If it does not work here, there's likely some conflict between PC hardware and window OS, and you should try to find this symptom in other applications to get more info.
Here's what i would be looking for:
Does it happen EVERY TIME?
Does it happen after you debug your project ? does it happen for ALL projects?
Does it also happen when you don't load any projects? (simply start the IDE and wait).
Does it happen after a debug session of your application? maybe the application is not closed properly?
Do you have any other apps running at the same time that may cause this? try reproducing with a minimal set of apps/services running.
What are you doing exactly when it starts freezing ? anything in particular?
I would try to get 2-3 memory dumps at the time of hanging, post it here as well as to MSFT people. That would be a good start.

Visual Studio 2010 crashes repeatedly

I've been running Visual Studio 2010 (the official release) for some time now. Lately, VS will crash 10+ times during my 8 hour work day. In VS2008, crashes were common when working with large Xaml files, and while I experience some of that with VS2010, crashes occur when debugging, starting the debugger, stopping the debugger, and other random times when editing code.
I've looked through the problem reports, and the one I've found that occurs most frequently is:
Description
Faulting Application Path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Problem signature
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 10.0.30319.1
Application Timestamp: 4ba1fab3
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdb3b
Exception Code: c0000005
Exception Offset: 0002e23e
I'm running Windows 7 (x64). Hoepfully someone has come across this problem and has found a solution. I plan on reinstalling VS2010. Hopefully that takes care of the problem.
Do you think you have installed any extra Extensions which might lead to frequent crashes?
You can try
Devenv.exe /SafeMode
to start in Safe mode. You can also try
Devenv.exe /Log
Which will log all activity. Have not tried this so don't know What activities are logged.
Visual Studio 2010 Command Line Switches
I was having a similar problem and this helped me
http://connect.microsoft.com/VisualStudio/feedback/details/618802/visual-studio-random-frequent-crash
Running this from the command prompt seemed to fix it. It hasn't crashed for the whole day today.
regsvr32 c:\Windows\System32\ole32.dll
I had similar issues with Visual Studio. The problem was the service pack which for some reason was not installed properly.
I had to reapply the SP1 using the Repair / reapply option. This kind of fixed my issue.
Also make sure to reboot the system.
Just to help people who search it: It was webex instant messenger related part, but not Cisco itself. The cause was a component in Studio Power Tools relevant to integration with messenger. Reinstall power tools but without messaging integration.
In other occasion it is almost always a corporate antivirus authentication helper thing. It required to manually remove registry entries which cause background TFS logins break the studio at random moments.
I had the "Microsoft Visual Studio 2010 has stopped working" error, imediately when Visual Studio 2010 was starting. Fault module was clr.dll in my case. Only rebooting helped sometimes.
I solved it by removing .NET completely and reinstalling it.
Be aware that if you updated to .NET 4.5 this includes .NET 4, so you have to remove and reinstall .NET 4.5
I know why it could be crashing. Code it self. Have you tried to debug the failed instance of VS2010 with Vs2010? If the xaml designer crashed anywhere in your code you should be able to see the stack trace. Also, try to load the same xaml into Blend 4 and then run the vs2010 on Blend when that crashes. I've had some good results debugging Vs2010 crashes like that.
There are so many things that can cause studio to crash.
I'd look at everything from video card drivers to whether the RAM is stable.
Note, there is a microsoft connect but on this exact issue at: http://connect.microsoft.com/VisualStudio/feedback/details/634162/devenv-exe-frequent-intermittent-crashes-fault-module-name-ntdll-dll
You might vote on it or add your own information to the report but the very first thing I'd do is update my video drivers. One place I was at had a lot of issues with 2005; it would randomly crash just displaying the design surface or when opening a few too many code files; but once we got decent video cards and the appropriate drivers installed it worked flawlessly.
I disabled “Options"-"Evnironment"-"Add-in/Micros Security"->"Allow macros to run", and fixed the problem.
I think I just solved a similar issue on my computer, but probably not the same cause. It was related to TortoiseSVN (I think visual loads the tortoise DLL because it is integrated with the explorer, even if I don't have a specific visual studio plug-in). I upgraded TortoiseSVN (from 1.7.8 to 1.7.11) and it didn't crash for a few hours (I also had a 100% repro case when closing visual studio which does not happen anymore). Maybe there is some way to check what DLLs are loaded by visual studio to troubleshoot what are the candidates for upgrading/uninstalling, but I didn't go this far.
Hope it can help someone else.
While developing C++ code, Visual Studio 2010 started crashing frequently and at random times after I enabled the Task List.
As an alternative to using the Task List, I am now simply using the Find in Files tool (Ctrl+Shift+F) and searching for the string TODO as an alternative.
i was having a similar problem. visual studio 2010 was crashing. when i attached, it said it had a read access violation in ntdll.dll
closed all my open instances (there were 5) and it stopped happening.
Today I had this error, in my case it was because Microsoft released the update (KB2858725) the FrameWork 4.5.1, which the download and installed,
However this is definitely addressed by performing the following steps:
FrameWork 4.5.1 download (KB2858728) => NDP451-KB2858728-x86-x64-ENU.exe-Allos
http://www.microsoft.com/en-us/download/details.aspx?id=40779
Install the downloaded software (KB2858728)
Try Vs, but give the same error.
Uninstall the downloaded software (KB2858728)
(this task fully cleaned upgrade giving problems (KB2858725)
Install the downloaded software (KB2858728) again
Try Vs, this time if it will work
NOTE: NEVER! install update (KB2858725)
Logging helps indeed. I have the same problem with crashes. Since there could be numerous reasons and lots of log data, I wrote this .bat (Win7 x64, VS2010 Express) to keep logs organized and easy to analyze:
#echo off
rem date and time in format YYYYMonDD_hhmmss
set year=%DATE:~-4%
set month=%DATE:~3,2%
set day=%DATE:~0,2%
IF %month%==01 set monthstr=Jan
IF %month%==02 set monthstr=Feb
IF %month%==03 set monthstr=Mar
IF %month%==04 set monthstr=Apr
IF %month%==05 set monthstr=May
IF %month%==06 set monthstr=Jun
IF %month%==07 set monthstr=Jul
IF %month%==08 set monthstr=Aug
IF %month%==09 set monthstr=Sep
IF %month%==10 set monthstr=Oct
IF %month%==11 set monthstr=Nov
IF %month%==12 set monthstr=Dec
set now=%TIME:~0,-3%
set now=%now::=%
set now=%now: =0%
set now=%year%%monthstr%%day%_%now%
start "VS2010 express" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" /Log "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSlogs\VS_log_%now%.txt"
I had the same problem. I cleared my settings. Configured environment to use C# development settings. Then i disabled all extensions against which disable button was present. I enabled them one by one while opening, running and closing solutions. I found the offending extension to be .Net reflector v 8.5.0.179 by red gate. I had VS2010, VS2012 and VS2013 all installed on my windows 8.1 enterprise 64bit. All of them had the same issue. Whenever i closed the solution VS would crash. Hope it helps.

Resources