How to get Visual Studio 2013 manually into safe mode? - performance

I know this might a common question. I don't really know why but my VS 2013 got really really slow yesterday. Every open VS is sucking up 25% of the CPU-Power. When I start it in the Safe Mode, everything is allright. So it has to be thrid party extensions.
I cann't figure out how to turn off all extensions. Via Tools/Extensions Updates I some extensions cannot be disabled or uninstalled (button disabled). Neither can I figure out what extension is malicious.
Will it even help to reinstall the VS?
thanks

You can try to run the command devenv /setup again via the commandline.
This Forces Visual Studio to (re-)merge the resource metadata that describes menus, toolbars, and command groups, from all available VSPackages.
The command must be run as an administrator. See also MSDN and Cleaning up the VS Environment when things go wrong
I had the same problem with Resharper that slowed down my VS. Running the command fixed my problems.

0) To answer the title of your question, you can launch VS in safe mode using the /SafeMode command-line switch: https://msdn.microsoft.com/en-us/library/ms241278.aspx.
2) To reinstall VS without finding the root cause won't prevent the problem in the future.
1) The safe mode prevents loading 3rd party extensions, but then you can't enable them one by one to find the culprit. So you have to disable or to uninstall one by one:
First, extensions can be mainly add-ins or packages (and MEF extensions).
Add-ins can be unloaded in the Tools > Add-In Manager.
Packages can be disabled (in some cases) or uninstalled (some of them require you to launch VS with admin rights, and some of them require you to use the Control Panel > Programs.
If the package is 3rd party, you can reinstall it later. But if the package belongs to VS, you need to rerun the VS setup.
There is another approach: Process Monitor (https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) allows you to spy disk, registry and network activity, which may give a clue of the problem. And Process Explorer (https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) allows you to select the devenv.exe process, select the Properties window and go to the Threads tab, which gives you the CPU usage per thread, maybe also a clue.

Related

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. .

What is vshub.exe in the system tray?

I installed Visual Studio 14. Now I have a new app VsHub in the system tray / notification area. What is it? I tried clicking and right-clicking on it, it doesn't do anything.
According to Visual Studio Blog site (http://blogs.msdn.com/b/visualstudio/archive/2014/08/18/visual-studio-14-ctp-3-released.aspx?PageIndex=2&wa=wsignin1.0):
"The Visual Studio Hub is an executable that supports multi-tool
communication across the VS family of apps, service
composition/isolation, and data/compute outside of the Visual Studio
process."
I solved stopping the folliwing Windows service:
Visual Studio Standard Collector Service
After stop, my pc is returned to work correclty, without strange load.
I hope this help you.
I have a slightly more direct solution to this. It's relatively trivial to locate where VSHub.exe and its cohorts are on your hard disk. Just go into that directory, take ownership of all the .exe files contained in it, and for each of them use "Right Click" / "Properties" / Security, and add an ACL that denies execute permissions to everyone.
Problem solved. You will need to re-do this every time you update VS 2015, but on my low power laptop, I simply can't afford the resources to keep all these unnecessary tools running. VS 2015 runs just fine without them: I can edit, build and debug programs without any problems at all.
Sure, I may be missing some of the more esoteric features of VS 2015, but for my use case YAGNI

Debugging with Visual Studio 2012, Windows 8 and User Account Control

First of all - this is all about the RTM Versions. And Windows 8 has some changes regarding the UAC, as we all learned from http://www.brianbondy.com/blog/id/140/, it cannot be disabled side-effect-free.
Now the problem starts:
Our main app requires elevated privileges (at least the server part). Debugging will only work when running VS in elevated mode, too. But when I'm starting a Silverlight Project in elevated mode of VS, the IE fired up for debugging is started as with normal privileges and debugging is not possible, too. To make things more complicated, we're not running solutions with all (700+) projects loaded, but do lot of our dev-stuff (compiling, starting, testing) in command line. Which needs to be elevated, too.
What is the correct configuration of UAC for this purpose: I want to be able to debug Silverlight applications running in Internet Explorer, Applications of any kind started by VS "F5", a server process started from commandline and (maybe) C#/XAML Metro-Apps?
In Windows 7 it was just disabling UAC and everything's fine. Now I feel like fighting against my own toolset and have a bad feeling about this.
And please - do not tell me that UAC is important and useful. I'm totally okay with it, but for a developer things are slightly different.
See this answer on Superuser:
The Only way I'm aware of which ensures it will always open as
Administrator (including when you open from file associations, jump
list etc) is:
Locate the devenv.exe file in Explorer eg mine is in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\
Right-click devenv.exe and choose "Troubleshoot compatibility"
Select "Troubleshoot program"
Select "This program requires additional permissions"
You'll need to let it launch VS before it lets you click Next, but
then you're done.
EXTREMELY annoying that you can't just do this through the normal
properties dialog any more. It's like Microsoft are going out of their
way to ensure Windows 8 alienates as many people as possible...
Have you tried installing VSCommands and using the Always start Visual Studio with elevated permissions option? I'm not sure how this would function differently than restarting with elevated permissions but it can't hurt to try.
I ran into the same issues with the command line, debugging, and other things such as once you're running with elevated permissions you can no longer drag & drop files into Visual Studio, or open files associated with Visual Studio when it's set to always run with elevated permissions. This is why I've always disabled UAC.
In the end I just turned off UAC in the registry. I'm not missing out on anything by doing so. It would be nice to hear how Microsoft uses the Win8 + VS2012 combo internally after seeing how broken it feels.

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 freezes when switching to debug mode

Strange Visual Studio (TS 2008) problem: The IDE completely freezes whenever I switch from Release to Debug mode in a specific project. It happens right as I switch, before I try to build or do anything else.
The whole thing started out of the blue, without any abnormal change I can think of.
I tried to clean the solution, but it didn't help.
Anyone ran into this before?
If everything has worked fine and then stopped, usually it means there was some problem even though it had passed unnoticed.
Things I would try one after another:
Check which files were changed (why and how) after update from a source control engine
Review the list of extensions and plugins. Try to disable all or some of them
Close Visual Studio and kill all the development processes: devenv, mspdbsrv, vcpkgsrv, msbuild, msvsmon, vshub, vstest etc
Remove .suo, .ncb, .VC.db, .VC.VC.opendb files of the solution as well as .vs directory, which sometimes cause problems
Remove project setting files, sort of YourProjectName.vcproj.DOMAINNAME.LOGINNAME.user or YourProjectName.csproj.user. The setting file name depends on a project kind you use
Run "C:\Program Files\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup or "C:\Program Files (x86)\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup for x64 environment
In some complex cases, it helps to remove user settings, located in home %USERPROFILE%\AppData\[Local|Roaming]\Microsoft\VisualStudio[vs_version] and in registry HKCU\SOFTWARE\Microsoft\VisualStudio[vs_version]
It should reset all things to the beginning state. If it won't work, so there are additional tools to investigate. Download Process Explorer and once IDE freezes, start the Process Explorer, find the devenv process, double-click on it and go to Threads tab. Check, which thread has the biggest switch delta in case of the freeze, double-click on it and take the name (or offset) of the top function. It gives additional info where the problem may be.
Moreover, sometimes it helps to repair Visual Studio in the "Add or Remove Programs" wizard in Control Panel.
Had this problem in 2017. I ran VS 2017 as Administrator and it worked.
I've encountered this in VS 2017 (15.8). Upgrade to the newest version (15.9 at that time) resolved the issue.
VS seems to be doing a lot behind the scenes and putting project-specific files in App Data and who knows where else. I had this experience: I had a project which had two sets of identical code in two different directories: one for production, one for development. The development project started hanging on debug, the production did not. Tried all kind of settings and deleting .suo files, but no help. So I renamed the directory that the development version was in and presto, eveything worked without hanging.
In my particular case, I tried many other answers with no luck. It turned out that a call to this was hanging the debugger:
Log4NetExtensions.AssertFail("Error");
I managed to narrow it down to this line of code by bring up the threads window under [ Debug > Windows > Threads ] and clicking on the current thread to browse to the line of code it was hanging on.

Resources