Visual Studio freezes or hangs on startup - visual-studio

I have been using Visual Studio for a while and found that when I open visual studio and open the project all the files that were open last time remain open.
This causes my Visual Studio to freeze or crash on startup.
I am using a lot of plugins in my installation and wonder if there is a way to prevent this from happening.

Have you tried resetting user settings? It did help me:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /ResetUserData

Run: Devenv /ResetSkipPkgs
http://msdn.microsoft.com/en-us/library/ms241276%28VS.80%29.aspx
or
You are probably looking for the /SafeMode command line switch:
devenv.exe /SafeMode
This will start Visual Studio with all add-ins disabled.

You can change your Visual Studio 2010 start up settings.
Tools --> Options --> Startup --> At startup --> Show empty environment --> Save
Visual Studio has a plugins limit. Use only plugins that best for you. There is a list for best Visual Studio 2010 plugins for developers.
Visual Studio 2010 - recommended extensions

devenv.exe /ResetSettings
or
devenv.exe /ResetSetting
Worked fine for me

I had the same issue with Community 2015 version. I solved it with Vidas Vasiliauskas suggestion, which was to erase user settings.
The thing is that I previously had enterprise 2015 version, in which I was logged in with my Microsoft account. When trying to open community version, it tried to do so with that same account, which I believe was the cause of the issue.
Therefore, I would suggest to those with the same problem to run the following command at Command Line Prompt:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /ResetUserData

In my case, VS 2013 Professional was hanging on startup because the license was no longer valid.
Last item in the log file:
<entry>
<record>367</record>
<time>2015/07/13 20:11:05.051</time>
<type>Information</type>
<source>UserConnection</source>
<description>myemailaddrs#gmail.com signed in for IDE user</description>
</entry>
And on the msdn.microsoft.com subscription page: "Your subscription is no longer active, contact your administrator."
I had to get an updated subscription from my employer.

When it hangs on the splash screen:
It could be that an anti-virus solution is blocking Visual Studio.
Kaspersky Internet Security 16.0.1.445 makes Visual Studio 2015 hang on the splash screen. The older version 16.0.0.614 works fine.

Clear the tag's elements in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
Also do the same with C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
The tag should just be <runtime/>

If your Visual Studio 2019 is stuck due to a faulty extensions, here is a way to get it back to normal.
First, start Visual Studio in safe mode (devenv.exe /SafeMode) and uninstall the troublemaker.
Hereafter, if Visual Studio 2019 is still unresponsive, you need to do the following:
Browse to %LOCALAPPDATA% and go to Microsoft -> VisualStudio -> 16.0_bb6da863 (or whatever version you have installed)
Delete the following folders (all cache related):
ComponentModelCache
ImageLibrary
MFECacheBackup
Extensions\*.cache
For reference:
Hope it helps you and safe a VS repair/reinstall.
Happy coding :-)

I was having this issue when using the Git source-control plugin.
I ran devenv.exe /SafeMode
And then in Options -> Source Control -> Plug-in Selection made sure "None" or "Visual Studio Team Foundation Server" was selected. After that, VS started normally.

Check Task Manager. I had a Setup.exe running (not sure what it was installing), but once I killed it, VS unfroze.

I have got recently VS2017 stucked on start up . so I did this and worked for me :
1 - start cmd as admin : run the following:
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE"
devenv.exe /SafeMode
2- once VS is started , go to
Tools => Extentions and Updates :
then uninstall all plug-ins that installed recently ( notice the installed date ) and unnecessary ones)

This helped me: I deleted all SDK, JDK & JRE folders that had been rooted in VS settings before. After that I used devenv.exe /ResetUserData and devenv.exe /ResetSettings.
Worked for me on Visual Studio 2015.

This is becuase of rendering IDE UI try this hope it will resolve
1- Open "Visual Studio"
2- Select "Options" from the top menu
3- Navigate to "Environment => General"
4- Unchecked "Optimize rendering for screens with different pixel densities"
5- Restart visual studio

Related

Visual Studio "Extensions and Updates" remains disabled

Recently, I disabled all the extensions at "Extensions and Updates" window in Visual Studio 2017. Now I am trying to enable them but it doesn't work. When I enabled the extensions Visual Studio says:
These changes will take effect the next time Microsoft Visual Studio is opened.
But, when I close the VS and reopen it again, they remain disabled. I tried to restart the system after closing the VS, but this also didn't work.
Is there any one knows how to solve this issue?
Is there any one knows how to solve this issue?
Since there is no specific error info, to resolve this issue, I would like provide you some troubleshootings:
Make sure you are using latest version of Visual Studio.
I test it with the latest version 15.5.2 without this issue. If you are not in the latest version, please update your Visual Studio to latest version first.
Run Visual Studio in safe mode:
Please open an administrative CMD window and navigate to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE and run these commands:               
devenv /safemode
It prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution. if it works, this issue should be caused by the extensions and you need to remove the installed extensions under Tools—Extensions and Updates.
Clean the extension cache:
If it doesn’t work in safe mode, please have a try with delete or rename the following folders:
C:\Users\\AppData\Local\Microsoft\VisualStudio\15.0
C:\Users\\AppData\Roaming\Microsoft\VisualStudio\15.0
Meanwhile, run visual studio as administrator, disable any Anti-Virus or Anti-Spyware software on your computer and clean %temp% folder.
Hope this helps.

Error message "No exports were found that match the constraint contract name"

This morning I faced a problem while opening my Visual Studio solution, and when I tried to run it, it said:
No exports were found that match the constraint contract name
How can I fix this problem?
I solved this problem by clearing Visual Studio Component Model Cache.
Just delete or rename this folder:
%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache
or
%LocalAppData%\Microsoft\VPDExpress\11.0\ComponentModelCache
and restart Visual Studio.
The version of Visual Studio you have is specified by the number e.g.
Visual Studio 2012 is 11.0 (as shown above)
Visual Studio 2013 is 12.0
Visual Studio 2015 is 14.0
Visual Studio 2017 is 15.0
Visual Studio 2019 is 16.0
For those that don't know:
%LocalAppData%\ is the same as C:\Users\{yourUsername}\AppData\Local
For those who have multiple versions of Visual Studio installed, e.g. 2012 and 2013, it might help to remove the ComponentModelCache for both versions before restarting Visual Studio, e.g. 11.0 and 12.0.
No need to rename or delete the whole folder:
(%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache)
Just rename or delete the Microsoft.VisualStudio.Default.cache file inside the above location.
Visual Studio Express 2012 has different paths.
Visual Studio Express
...\Users\{user}\AppData\Local\Microsoft\WDExpress\11.0\ComponentModelCache
With Visual Studio Express 2012 for Web
...\Users\{user}\AppData\Local\Microsoft\VWDExpress\11.0\ComponentModelCache
I did not have to re-install Visual Studio Express
This will really work like a champ:
Solution: Try to delete ComponentModelCache folder from the below location.
[C:]\Users\[your user name]\AppData\Local\Microsoft\VisualStudio\[Visual Studio version number]
And after successful delete, recreate the folder with the same name, "ComponentModelCache".
This issue can be resolved by deleting or clearing all the folders and files from %AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
This actually clears the Visual Studio component model cache.
On Windows 7 machines, the path is different. When you type %appdata% in Run dialog, it opens the folder C:\Users\<username>\AppData\Roaming.
Click the 'up' button to navigate to the parent folder and select the folder 'Local'.
Final path: C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
Deleting the Component Model Cache did not work for me (well, the relative directory given above did not exist in my machine). Instead, I installed an extension to Visual Studio 2012 Express. Menu Tools → Extensions and Updates... → Online → Choose any and then download. This apparently invalidates the cache causing Visual Studio to rebuild it.
Here's my source.
For Visual Studio 2013 you need to remove that folder from this path:
%AppData%\..\Local\Microsoft\VisualStudio\12.0
for Visual Studio 2012 and later versions, the solution must be deleting the content of the folder ComponentModelCache:
C:\Users\[username]\AppData\Local\Microsoft\WDExpress\11.0\ComponentModelCache
Visual Studio 2013
C:\Users\[username]\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
I had the same problem upon launching Visual Studio 2013 Ultimate, and the solutions here didn't work for me. I tried deleting the mentioned folders and starting Visual Studio again, but it didn't work.
However I had other problems too, like Microsoft.visual studio package did not load correctly and also Page '312e8a59-2712-48a1-863e-0ef4e67961fc' not found VS 2012. The latter refers to a message in the Team Explorer window saying "Page 'somenumber' cannot be found".
So I run devenv /setup on the Visual Studio command prompt with administrative rights. It did the job, and everything is fine now.
Remove ComponentModelCache folder content.
%AppData%..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
Clearing the folders didn't work for me. So I went to 'Programs and Features' and used the change button to startup the Visual Studio 2013 setup.
In the setup I choose the repair function and that fixed the problem for me.
I had the same problem with Visual Studio Express 2013 of Windows 8.1.
Unfortunatly there was no "ComponentModelCache" folder in
%AppData%..\Local\Microsoft\VisualStudio\12.0\ComponentModelCache.
I found the "ComponentModelCache" folder in
..\Users[username]\AppData\Local\Microsoft\WDExpress\12.0
and solved this problem by removing this folder from there.
If you have VS 2013, you have to go to: %LOCALAPPDATA%\Microsoft\VisualStudio\12.0
then rename the ComponentModelCache folder.
I experienced a similar problem after some updates released from Microsoft (part of them where about .NET framework 4.5).
On the Internet I got the following link to the Microsoft knowledge base article:
Update for Microsoft Visual Studio 2012 (KB2781514)
It worked for me.
This happened to me with Visual Studio 2013 Web, after Windows installed several updates. Unfortunately none of the suggestions in this thread helped.
I had to re-run the installer and select the "Repair" option. After that (and a reboot) it was working once again.
In some cases you may have to repair more than one version of Visual Studio. One example is when a Script Task control in VS 2013 opens VS 2012 when you click Edit Script.
Renaming the ComponentModelCache folder worked for me in Visual Studio 2015, but with a slightly different path:
%AppData%\..\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
I have Windows 7 x64 with a second partition on which Windows 8 (preview installed). While working with Microsoft Visual Studio Express 2012 for Windows Phone, I come up with the same problem. But the ComponentModelCache is found here:
C:\Users\Jayaram\AppData\Local\Microsoft\VPDExpress\11.0
I am unable to delete or rename as I get the "access is denied" message when I try to use command prompt:
Administrator: VS2012 X64 CrossToolsCommandPrompt
This issue is because of a MEF cache corruption.
Installing the feedback extension (or installing any extension) will invalidate the cache causing VS to rebuild it.
click for source.
i experienced this problem in Microsoft Visual Studio Express 2012 for windows phone while trying to open file.
Then i browsed to
C:\Users\MyUserName\AppData\Local\Microsoft\VPDExpress\11.0\ComponentModelCache
And Inside ComponentModelCache i deleted Microsoft.VisualStudio.Default.cache CACHE file. Finaly i restarted visual studio and reopened my project.
Then my problem was solved, i was able to open file.
Note: My OS is windows 8. And i installed SDK 8 for developing windows phone app
Thanks
I am using Visual Studio 2012. After installing the Visual Studio 2013 web express, when I want to run or open any project in Visual Studio 2012 it shows me the following error:
"no exports were found that match the constraint contract name".
I also tried the above solution for clearing the ComponentModelCache,
but I did not find the folder. I solves my problem just by: Repair Visual Studio 2012
For the Express versions of the software, the folder you need is in a slightly different place(s): For Express 2012 for Web it is C:\Users\XXXXXXXX\AppData\Local\Microsoft\VWDExpress - not in the Visual Studio folder.
I got an error with the same error message - two years later.
It's a different problem this time though, related to .NET Core dnx things.
I couldn't find an answer on Stack Overflow, but there's a GitHub issue that contains a workaround: https://github.com/aspnet/Home/issues/1455
Below is the most important part of the workaround:
Delete the entire C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX directory. (As far as I understand, it belongs to the old version of ASP.NET Core
RC1, which for some reason is still shipped even with Visual Studio 2015 Update-3).
Delete the C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config file.
Run the Developer Command Prompt for Visual Studio 2015 as Administrator, and execute the devenv /setup command. The new devenv.exe.config file is generated. This time there are many assemblies that refer to the
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\DotNet directory.
Run the Visual Studio 2015 and check that it shows the Microsoft .NET Core Tools (Preview 2) 14.1.20624.0 in the Help => About Microsoft Visual Studio menu.
Thanks to olegburov's post on GitHub for figuring this out.
I had to uninstall some external components like Postsharp and Apex and then it worked. I also tried the chosen solution but it gave me more errors.
Deleting the folders haven't worked for me i have go control panel and repaired
Visual Studio Installer Projects extensions for VS 2013.
And it worked for me
I got this error after reinstalling IntelliJ IDEA and ReSharper for C# in Visual Studio 2013.
First, I got an error problem with extensions, and after this I got this error:
"No exports were found that match the constraint contract name”
I simply removed folder ComponentModelCache and resolved this error.
My 2 cents:
Following all above lifesaving tips, I had a slightly different experience; mine is VS 2017 Community Edition, installed once, and I notice that have all these 3 folders:
%LocalAppData%\Microsoft\VisualStudio\15.0 ==> Empty
%LocalAppData%\Microsoft\VisualStudio\7f0c75b0 ==> has only the CoreCon folder
This is the one that has the ComponentModelCache:
%LocalAppData%\Microsoft\VisualStudio\15.0_7f0c75b0
Deleting only the Microsoft.VisualStudio.Default.cache had no effect.
So, I deleted all 4 files there: .cache, .err, .external and catalogs.
On restarting VS, problem gone and appeared a 5th file:
Microsoft.VisualStudio.Default.scan
Removing ComponentModelCache did not work for me. Reinstalling VS 2019 did thanks to a recommendation on this Microsoft support thread.
Details
This seems to be a known bug with a fix incoming from MS (as of 1/7/2020)
Experienced after upgrading from VS2019 Pro 16.2 (i think it was?) to 16.4.2 using Visual Studio Installer
Error displayed when trying to launch both nuget console and nuget package manager

Page '312e8a59-2712-48a1-863e-0ef4e67961fc' not found using Visual Studio 2012

When I click on the home-icon of Team Explorer, I get the following error:
Page '312e8a59-2712-48a1-863e-0ef4e67961fc' not found instead of all the options.
I have this error since I reinstalled the Visual Studio 2012 Ultimate trial and installed the Visual Studio 2012 Premium edition. Repair and reinstall didn't work out.
To fix this, run this from the Visual Studio command prompt as administrator:
devenv /setup
It will not mess up your environment, and you can just continue to use Visual Studio afterwards was my experience.
I had the same error in Visual Studio 2013 and tried:
Control Panel → Programs .... → Visual Studio → Repair
It did not work
devenv /setup
It did not work
devenv /clearcache
devenv /updateconfiguration
It did not work
And then THE solution:
*Close all Visual Studio instances
Delete the %LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ComponentModelCache folder
Start Visual Studio
It is explained in more detail in this blog post: When the EditorPackage does not load correctly
I had this error on Visual Studio 2013 Ultimate - Windows 8:
And I solved this problem running this command:
X64: devenv.exe /resetskippkgs
x86: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe /resetskippkgs
I faced similar issue. Running devenv /setup did not help me.
Just wanted to share some additional info:
At first, devenv /setup did not help me as well. Then I realized that I was using the wrong Visual Studio command prompt version.
Make sure that you run devenv /setup for the appropriate Visual Studio version.
For example: for Visual Studio 2013, use the "Developer Command Prompt" under the Visual studio 2013 "Visual Studio Tools" folder.
*And like it stated in the selected answer, run as administrator.
I ran the suggested command: devenv /setup. It didn´t work for me. (Visual Studio 2015)
Then after that I tried something different:
-> Run Visual studio as administrator, after ran the command.
Then the problem was solved.
Running Visual Studio as administrator resolves this for me.
After I reinstalled my Visual Studio 2012 Trial, I've never deleted the documents directory. In this directory there were some backup files. This maybe have caused the problem.
After deleting this directory and installing Visual Studio 2012 Premium again the problem was solved.
I faced a similar issue. Running devenv /setup did not help me.
I found Fixing 312e8a59-2712-48a1-863e-0ef4e67961fc-not-found-vs-2012. This link suggests that I might have recently installed some Visual Studio extensions, which might have corrupted the Visual Studio maintained cache. I uninstalled a couple of the latest Visual Studio extensions, and it solved the issue after Visual Studio's restart. Visual Studio is able to connect with TFS :-).
One can find Visual Studio extensions at menu Tools → *"Extensions and Updates...". Go to the "All" section under Installed section. It will show all Visual Studio extensions.
I had a similar error, and then I tried running "devenv /setup" and no good result. That's was because you don't not trying with specific version Visual Studio command prompt. I then opened the command prompt for the specific version "Visual Studio 2013", and the problem was solved.
I had the same exact issue in Visual Studio 2013. I renamed ComponentModelCache to ComponentModelCache2, and it fixed it.
C:\Users\{..}\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache

Visual Studio 2010 Unknown Error on Startup

I'm trying to launch Visual Studio 2010 from my desktop and I just get this error box popping up saying "Unknown Error"...
Anyone have an idea why this might happen?
I just fixed it, I uninstalled and reinstalled my version of the .NET Framework (v4.0). And then when I again tried to launch Visual studio it started up without any issue.
Here's some things you can check:
Temporary de-activate all Addins
Temporary disable all Extensions
Check the Event Log for any errors
Reset your settings
Start with /ResetSkipPkgs
Based on your comment below, if you can't find the DevEnv.exe when you have opened a VIsual Studio Command prompt, I would suggest you to re-install Visual Studio as it indicates your installation (paths) are in a bad state.
And here are some other things you migh want to check:
VS 2010 Crashes on Startup with "Unknown Error"
Visual Studio 2010 quit working...now gives me an "unknown error" dialogue when launched
Visual Studio 2010 Startup Errors
Visual Studio 2010 crashes on startup after installing SP1
Open Visual Studio Command Prompt with Administrator permission and type the following,
devenv /ResetSkipPkgs
the Solution of this problem ist very simple.
Install VS 2010 on a other machine and export HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0 to a file. Copy the file to your target machine and rename the path above to ".old", then double click your exported reg-file and wait a time....
After this my Visual Studio was starting correctly.
The other solution, that people post wont work in my case.
I hope this will help some body.
Enjoy
Sven
I had the same problem.. Instead of completely uninstalling .net framework, I just repaired the .net framework from the repair/uninstall option available in Control Panel of my Windows 7 Ultimate pc. Finally I got another error that, Visual Studio could not create AppData folder in my system. Then, I right click the Visual Studio icon and selected Run as Administrator. This worked for me!! Now, Visual Studio 2010 is working on my pc!! Try this out if you want..

Visual Studio 2005 Intellisense stopped working after ReSharper installation

I installed the ReSharper evaluation version and uninstalled it. Afterwards Visual Studio's Intellisense stopped working. I have restarted computer but I still have this problem.
Can anyone please help me here?
I am using Visual Studio 2005. Thanks.
Try opening Visual Studio Command Prompt and entering:
devenv.exe /ResetSettings
Try going to Tools > Options > Text Editor > C# and checking all of the options under Statement completion. I think Resharper disables these upon installation.
Sometimes deleting the ncb file helps. Go to your solution directory and find the sln file, there will also be a file with the same name and the extension ncb. Make sure Visual Studio is closed (at least don't have that project open) and then delete that file. Don't worry Visual Studio will rebuild it for you.
The devenv.exe /ResetSettings was the only thing that worked for me. The full path in command prompt is as follows (for VS 2008)
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv.exe /ResetSettings
took me a while to find so I thought I'd post this to help
devenv /ResetSettings worked after uninstalling ReSharper. I did not have to do a repair. I did verify that the settings were checked under Text Editor > C#, but ResetSettings was the only thing that worked.
You could try to reset your Visual Studio setting by
End Process devenv.exe from Tast Manager if it is running .(It can close your Browser and Visual Studio)
Run devenv /resetuserdata from Start -> Run
Hope It can help you.
Disable updating intelliSense like in this article:
http://amastaneh.blogspot.com/2007/11/disable-updating-intellisense.html
Eventhough for old version seems to work for me.
I would try a "repair" on the installation first. Control Panel, Add/Remove Programs, select Microsoft Visual Studio 2005, click "Change/Remove". It will load up the install dialog and give you the option to do a "repair".
YMMV, but at least it should reset a lot of the VS resources to their "fresh" state.

Resources