Visual Studio 2010 suddenly slow - performance

Recently, the editor for VS2010 suddenly became slow when I installed some extensions then uninstalled them. The program itself is running fine and starts up in seconds. Jumping around the menus is lightning fast, but editing code, there is a 1 second lag between the keyboard and the editor.
This happens on a brand new console application project with nothing in it. I have also uninstalled all extensions, resharper etc. The only extensions remaining are VisualHg, Ankh and Nuget.
I have an i7 with 16 gigs of RAM so hardware is NOT the issue.
Is there some sort of cache or files that VS could have locked onto?
How can I figure out what is causing the issue?
Well thanks to #jv42's suggestion, I installed the perfwatson extension and that sorted out the issue. I've since put some of the extensions back and VS2010 is running better than ever before.
I still don't know what caused the issue.

I would find a rollback point before you installed the plug ins. You could have malware that installed with the plugin but was not part of the uninstall. It could just be that the uninstall did not remove something it installed that was causing the problem. It is most likely going to be far faster for you to find a rollback point and start there than to try and figure out what process is causing you the problem and where it is hooked into the registry.

Try resetting your settings from the command line back to the factory default. Warning You will lose all your settings!
devenv /resetsettings
You can back them up, as well as reset, using this article.

finally refer this to fix my problem.
solution is:
Debug->Options and Settings->Debugging -> Symbols
change from All modules,unless excluded to Only specified modules
details:
here

Related

Why VS2019 get suddenly very slow and laggy while trying to debug a c# application?

I am working on a c# code for the last couple of weeks and I debug it very often.
VS 2019 was working properly but suddenly it got very slow and laggy when I tried to debug my code.
I checked all resources on my machine. All seem as before and are available enough.
Even I checked the same IDE with other codes. All runs and debugs fast enough as before.
I also updated my IDE to the last version (currently 16.8.5 by the end of February 2021).
Did anybody has the same experience with the VS2019 ever?
Thanks in advance.
Not sure whether the issue is caused your code with IDE environment together. Please try the following suggestions:
1) disable any third party installed extensions under Extensions-->Manage Extensions-->Installed to check whether an extension caused that.
2) reset settings under Tools-->Import and Export Settings-->Reset all settings and you can also make a backup of the settings
3) close VS, delete all files under C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_xxx\ComponentModelCache
and also delete .vs hidden folder under your solution folder, bin and obj folder.
4) type devenv /safemode under Developer Command Prompt for VS to start a pure VS and then try your project.
5) create a new project with your same code and check if this works.
Besides, if all do not help, you could try a small reproducible sample with us.
If debugging suddenly becomes slow, you might consider checking your symbol settings and debugging settings. If you for example enable .NET framework source stepping, debugging can be slow, or if you do not cache symbols or disable for example Just My Code or enable other stuff, like IntelliTrace or install a bad extension.
It might not be an alternative for you, but I am pleased to inform you that I have been using Visual Studio 2022 and it is radically faster. Yes, this is not opinionated, this is an observation. It IS faster. Maybe it is because I do not have many extensions on it, but it is also a 64-bit application with less memory pressure on the GC. So you can first check your settings and then give VS 2022 Preview versions for a spin. I have used it for months and the amount of bugs are rather small if you do typically development. For a Preview version, I am impressed with what they are working for nextgen Visual Studio.
You should also clean your solution and delete and bin and obj folders via for example Powershell script to make sure your binaries are updated. Then rebuild.
If you have "live share" extension enabled, perhaps can try to disable / uninstall that. This one was causing my problem.
Ok, #Mr Qian no 3 did the trick for me.
Situation: After a "Cleanup" (Microsoft Visual Studio\Installer\InstallCleanup.exe) my VS2019 was partially gone. Good tool. :-(
After (re)install, I had 2 folders "ComponentModelCache" over 2 folders of 16.0_xxx : 16.0_4f678462 and 16.0_119826cb
I renamed both "ComponentModelCache" folders (you can delete later, when it has effect)
Build ran as never before...
Thank you, Mr Qian
My problems started as I upgraded to Visual Studio 2022 (from 2019) and upgraded to Windows 11 (naughty naughty, two major changes).
Turns out Windows Defender didn't preserve my exceptions. Using this PowerShell script as a template saved a bit of time:
https://gist.github.com/Braytiner/be2497d1a06f5a9d943dc7760693d460
Performance is back to where is was pre my Windows 11/Visual Studio 2022 upgrade.
Visual studio 2019 (16.8.5) has this problem in debugging. I have updated it into 16.11.8 and it works properly.

Can't install Visual Studio - stuck on Visual Studio Hub Services

Now I have some big problems with installing Visual Studio Community.
These problems came when I got back to Windows 7 from Win10 (because I had some problems).
When I launched the actual Visual Studio for the first time on Win7, it loaded good, but I didn't have any templates. So I decided to reinstall it.
Uninstall went good, but when I tried to install it again, it just stopped at Microsoft Visual Studio Hub Services or something like that. It just really stopped, when I let it go, the progress bar never moved. Then it also said that it couldn't find it or something similar.
And then the fun starts. I tried to do it several times, same. Then I downloaded the Visual Studio 2013 Community, and it stopped on Build x86. Same like the Hub Services at the 2015 version. I gave up at this moment. But after that, I went angry and removed the all Visual Studio folders in the Program Files.
But later on, I found the Visual Studio 2015 Express for Desktop, I downloaded it and that time it said right at the beginning: A Prerelease version of Visual Studio Community is currently installed. Please uninstall it prior to proceeding with your current installation.
I listened to it, went to Remove and Add Programs thing (don't know what name is it in english) and yeah, there was a version of that Visual Studio I removed. I tried to uninstall it, but it just said something again: The installation source for this product is not available. Make sure that the source exists and that you can access it.. And that's basically all.
So I would like to ask, how to fix this thing. It's because of that movement from Win10 to Win7? Or because of the VS folder deletement in Program Files? Any answers are very welcome!
EDIT: Main problem is that it stops at Microsoft Visual Studio Hub Services, I managed to uninstall the 2015 Community version, but then it stops and just didn't move, the only way was to remove the process to shut down the installing window and cancel the installing.
EDIT 2: Well, kinda shy of my grammar back then, fixed some bigger mistakes.
When Visual studio is installed, several other programs get installed. So when you try to uninstall visual studio, you should uninstall all other bunch of programs which were installed along with actual visual studio(which is a bit burden). It take so much time for me to uninstall all the programs from my computer. So while re installing please make sure you uninstall all the other installed apps also.
[EDIT: you may want to scroll to the bottom for the nuclear option which I wish I'd discovered earlier!]
I've downgraded two computers from Windows 10 to 7, both with VS2015 on them. One worked and the other had its VS2015 break horribly. I also deleted the VS2015 directory and registry data that mentioned VS2015 and all sorts, and I had even more problems than you describe :) I think the difference is that I installed some new things (node.js and TypeScript) under Windows 10, and they inserted things into VS2015 which were no longer properly installed after the downgrade.
Here are my discoveries in a hopefully useful order:
When it hangs, what it's actually doing is trying to display this prompt asking you to supply the path to an installer it couldn't find.
You usually get to see these prompts if you 'Run as Administrator' the (main) installer (rather than letting it obtain Administrator privileges itself). Process Explorer helps shed light on this: if the main installer's window is associated with the child process, then the dialogues are visible. If the root process, they're not.
The prompt relates to old versions of packages that the installer wants to uninstall prior to installing a new one, and for some reason the installer doesn't know how to re-download those packages. It is usually looking under C:\ProgramData\Package Cache for them.
If you aren't seeing the dialogue, you can view logs in C:\Users\<you>\AppData\Local\Temp. Use the 'Details' view and sort this folder by date modified, to help you find the right one. Each sub-installer tends to make a new file so you may have to poke around a bit. Changing dates or file sizes also tell you that it's doing something.
Messages like this tend to be associated with the attempt to show a dialogue:
MSI (s) (24:D8) [13:00:25:033]: SOURCEMGMT: Trying source C:\ProgramData\Package Cache\{388D7468-1CCA-40C8-9F08-4C20E972E922}v14.0.25123\packages\BuildTools_MSBuildResMsi_amd64\.
MSI (s) (24:D8) [13:00:25:033]: Note: 1: 2203 2: C:\ProgramData\Package Cache\{388D7468-1CCA-40C8-9F08-4C20E972E922}v14.0.25123\packages\BuildTools_MSBuildResMsi_amd64\BuildTools_MSBuildResMsi.msi 3: -2147287037
MSI (s) (24:D8) [13:00:25:033]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
So, what to do about these missing packages?
If you have another computer with a working Visual Studio 2015 installation, you can copy the entirety of Package Cache from there to your bad computer (no need to merge folders that already exist) and that will hopefully catch many of them.
For the rest, I tried a few third-party uninstallers, and Revo Uninstaller helped. Go into its settings and enable 'Show System Components'. Then, whenever you identify a problematic package, you'll usually be able to find it in Revo Uninstaller. If you uninstall it, you'll see the usual prompt (cancel it), and after it fails, Revo's 'Moderate' registry cleanup option does the trick ('Safe' didn't). If you use the Pro version then you can multi-select and use the 'Quick Uninstall' batch option, which isn't quite automated - yes, I'm afraid it will be tedious - but with some patience, you can get through everything.
Identifying the problematic packages is still a manual process, but the good news is that you can cancel many of the prompts during a run of the installer without it aborting, so you can collect a lot of package names as you go. You can also look for patterns in version numbers; for me, a lot of them were 14.0.15123` or something like that.
For me, just one package didn't show up in Revo Uninstaller, and I searched the registry myself and deleted some occurrences. I'm not sure if that or the subsequent install of the new package was what did it, but even that one went away.
So, after all that, I'm pleased to report that Visual Studio 2015 has got through the 'Repair' operation with no further errors. I still need to reboot before I can see if it runs without a hitch...
[EDIT: Nuclear option follows]
It didn't. Many of the standard windows (code editor and error list to name a couple) failed to load with the error "An item with the same key has already been added". On the plus side, at least Visual Studio didn't suddenly exit moments after opening. So that's an improvement and 2-3 days well spent :)
After that:
I found this answer and tried the TotalUninstaller linked therein.
Then I deleted more of the installation where that uninstaller reported it couldn't delete a non-empty directory.
Then I was going to reinstall from scratch, but would you believe it - it gave me Modify/Repair/Uninstall options! So I ran the Uninstall. (Maybe Repair would have worked, who knows?)
Then I reinstalled from scratch.
There was just one more failed uninstall of an old thing (Microsoft Web Deploy), but it didn't even report a warning at the end because of it, and now my Visual Studio finally seems to be intact - fingers crossed! (I may never test that web deploy thing anyway - I mainly use it with Unity. Of course I had to install the Unity tools again.)
So yeah. I have no idea if this works by itself or if you also have to do all the other stuff. If you try it and find out, let us know.
Since you are still seeing Visual Studio in Remove and Add Programs, your environment may not be entirely clean and you will have to first completely remove Visual Studio from the system. This should be independent of whether you're using Windows 7 or 10.
You may need to do further research, but here are some initial pointers:
https://msdn.microsoft.com/en-US/library/Aa983433(v=VS.90).aspx
https://support.microsoft.com/en-us/mats/program_install_and_uninstall
Beyond trying those things and then re-attempting the install, please look for any logs generated from the failures. For example, in your %temp% folder.
In my case , I just restart the PC and after it boots up the VISUAL STUDIO 2015 will automatic come back and keep running. I did it with 2 PCs of users and with version Professional. Hope this helps.
Note : Please make sure to close all VS running on your PC before running install 2015 (in my case is VS Pro 2013) and make sure Windows updates have finished running (if they have).
Uninstall any version of visual studio 2015 you already might have installed.
Then, delete this key: I had a similiar issue and found finally as cause entries under
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\14.0. .

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 Periodically Hangs for Several Seconds

I'm having a problem where VS2010 Ultimate is freezing up every so often for several seconds before returning to normal operation. This happens several times during a session, and is obviously very annoying. I haven't been able to pin it down to any specific activity-- it seems to hang whenever I scroll around in a document, open/create a document, basically anything. Anyone else have this issue or know what might be the cause?
Incompatible add-ons or system configurations can cause Visual Studio issues (performance issue, error, etc).
Fortunately we can try to troubleshoot the issues by referring to the Visual Studio activity log.
Simply run the following command to run Visual Studio 2010 and log its all activities.
DevEnv.exe /log
The log file will be generated to:
XP
%USERPROFILE%\Application Data\Microsoft\Visual Studio\10.0\ActivityLog.xml
Vista & Windows 7
%USERPROFILE%\AppData\Roaming\Microsoft\VisualStudio\10.0\ActivityLog.xml
Once you run it, 2 files will be generated: ActivityLog.xml and ActivityLog.xsl
And when you open the ActivityLog.xml, it will contain something like this:
The problem was solved by deleting the user options file called SolutionName.suo.
Somehow it had gotten very big and probably corrupted. You will only lose your breakpoints and open files as far as I know, but rename it to be safe.
I know people have had problems with computers that are older or don't have as much RAM. I know my use of VS 2010 ultimate can run to 500 MB's sometimes and if you don't have enough RAM, then it will hang for a little.
I've had issues with VS2010 when debugging is running or if I'm opening files from a network drive. I'm not sure as I currently don't have any team server repos connected, but if you do maybe the connection to the repo might be an issue as well.
Turns out the issue was network related. One item in my solution was looking to a mapped network drive, which apparently didn't always respond fast enough.
My solution for that problem was beyond the scope of my thinking. I found it on this website, and it goes like:
Launch Internet Explorer. Go to Internet Options, then Advanced tab. Under the Security group, untick “Check for server certificate revocation“. You may need to restart Visual Studio.
My scenario is that I have network drives with references mapped via VPN. That should have to do with that.
I faced similar issue with Visual Studio 2008. I have not thoroughly investigated the issue though.
Reading your post it seems the behavior at your PC is really annoying, but for me it's not that frequent.
One thing I noticed, the frequency at which this happens is dependent on the RAM size and time elapsed since last setup. I came to this conclusion seeing the performance of machines of my colleagues.
I noticed that my anti-virus software tends to lock down my entire system sometimes. If you have an anti-virus application, you might try disabling it for a moment to see if it is the culprit.
I had a similar issue - that still happened after a /resetsettings, reinstall and using /safemode. For me, the issue was that Assembly Binding logging was turned on ago and I forgot to turn it off, it got to the stage where the log files concerned were >200MB and each append was taking ages...
Managed to find the issue with procmon from sysinternals. Suggest that anyone who comes across a similar issue tries procmon if none of the above solutions help.
My VS2010 would hang as well in a similar fashion.
DevEnv.exe /log would indicate it failed to load strings around the time it would hang.
Reinstalling VS2010 SP1 and deinstalling Resharper to install Resharper 7.1.3 solved the problem.

VisualStudio 2010 Freeze after each build

I Recently I installed VS2010 on my desktop. Everything was fine until I started noticing that after each build my computer freezes up(for almost 2-5 minutes). I removed all the extensions and tried still no luck.
Any suggestions ??
Actually during each build, I could see ExpansionsXML.xml file is being processed again and again.
I found a Microsoft support article (support.microsoft.com/kb/956549) that has resolved my issue.
What I did:
Delete the file C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\10.0\1033\ExpansionsXML.xml
Go to the registry and delete the following key: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Languages\CodeExpansions
Restart the IDE
I will update more if I see same issue
Install procmon, and see what's happening. Do you have anti-virus running? Does the problem go away if you disable it?
Have you tried starting devenv with the /ResetSettings option?
For spurious waits of a few seconds, I might also look for things like failing network accesses - perhaps with Wireshark and/or Procmon.
The install for VS2010 isn't actual too bad, so an uninstall/reinstall isn't the kind of misery it has been in recent earlier versions.

Resources