I jump between several different source control server, and there's one that Visual Studio refuses to remember. Whenever I open VS2017, it remembers two .visualstudio.com repositories and one LAN-located TFS server, but I can't figure out why this specific VSO repo is never remembered.
Any ideas for me to try? Perhaps there's a limit on the number of connections that get remembered (unlikely) or there's a config file somewhere that's getting cached.
ISSUE
While in VS, right-clicking on a file and selecting "Compare" will completely lock up Visual Studio.
The same happens when right-clicking inside the text-area of a file and doing a Compare.
The same happens regardless of file type... I've tried with .js .vb .cs .ascx .css
Attempting to click anything in the UI, including the minimize or close buttons, does absolutely nothing. The buttons don't even highlight to show hover / focus. The only way to close VS is through Task Manager.
Other staff with the same spec laptop as me, same version of programs, and same VS solution... are able to Compare just fine.
SPECS
Visual Studio 2017 Enterprise
Team Foundation Server 2015
Windows 10 Enterprise
16 GB RAM / i7 1.99 GHz processor
TROUBLESHOOTING
I've seen some suggestions of disabling "Identify Helpful Extensions" in Options => Text Editor => HTML => Advanced. No change.
I've restarted the Windows server that TFS is hosted on.
No events are logged in Event Viewer Application or System.
ADDITIONAL NOTES
With a solution already open, VS is currently consuming 0 CPU and between 220 MB and 240 MB of memory. When I attempt to Compare a file with TFS, and TFS immediately becomes frozen, the Memory remains mostly stagnant. Occasionally going up or down a few MB over the course of minutes.
Other staff with the same spec laptop as me, same version of programs,
and same VS solution... are able to Compare just fine.
This should be a client side issue, first try to clear TFS and VS cache.
For TFS2015 Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\6.0\Cache
Beside, you could also be able to change the Default Visual Studio Diff Tool . This will narrow down if the freezes visual studio issue is related to build-in compare tool.
How to change, the detail step please refer this blog. If clear cache not work and other tool works well, suggest you re-install your Visual Studio.
You can try closing Visual Studio and deleting %userprofile%\AppData\Local\Microsoft\Team Foundation\x.0\Cache and /or %userprofile%\AppData\Local\Microsoft\VisualStudio\xx.0 directories and/or opening Developer Command prompt and running devenv.exe /resetSettings and/or deleting HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\15.0 registry entry (of course, it may be a good idea to back up registry entry prior to deletion)
As others have suggested clearing the TFS and VS cache may fix the problem but doing so may have some negative side effects.
Before attempting a full TFS and VS cache clear you can clear the folder located at C:\Users{Username}\AppData\Local\Microsoft\Team Foundation{Version}\Cache
This may limit undesired side effects.
See:
Visual Studio 2013 and TFS - All excluded changes being included back automatically
My work requires that I retrieve javascript files from a TFS repository in Visual Studio 2012, correct any errors or make necessary changes, then commit them back to TFS.
I recently had a colleague go on holiday, so I had to open a solution to run a C# program from the solution in his absence.
Since running this solution, I've now got all my javascript files opening in a new solution, which is annoying as I have to close the solution without saving it every time I want to do a commit.
How do I stop Visual Studio from opening the files in a new solution, and get it back to its previous behaviour of just opening the file?
We have a really big solution with more than 200 projects and thousands of files. Despite of that the solution used to load pretty quickly in Visual Studio 2010 as well as 2012. However, after copying the whole SVN repository to another location, loading and closing the solution suddenly took extreeeemly long. (I am talking about 30-60 minutes here!)
I found a solution myself and I wanted to share it here, hoping that it might save someone quite a few hours of research and staring at the "Preparing solution..." dialog.
When inspecting the devenv.exe process with Process Monitor, I found out that it is pretty busy with accessing the .svn directory. Here is what I did (and this somehow solved the problem):
Kill Visual Studio
Open Visual Studio without loading a solution
Disable AnkhSvn as Source Control plugin (Tools->Options->Source Control->Plug-in Selection->None)
Disable "Document Well 2010 Plus" (VS2010) or "Custom Document Well" (VS2012) in Productivity Power Tools (Tools->Options->Productivity Power Tools) - I read that somewhere and it might have helped as well...
Close Visual Studio
Delete the solution's *.suo file. This is located in the same folder as the solution itself. NOTE: You will lose several settings for your solution, like currently opened files, breakpoints, bookmarks, current solution configuration & platform (e.g. Debug x86) etc.
Restart Visual Studio
Load the solution - it was much faster now!
Close Visual Studio
Open Visual Studio without loading a solution
Re-enable AnkhSvn and the "Document Well"
Restart Visual Studio
Open the solution - it was still loaded in seconds!
I do not know which of these steps actually solved the problem. Probably, not all these steps are required, but I did not want to reproduce the problem to find out which steps may be omitted. :)
None of those helped me, what I did... I watch with ProcMon of sysinternals, filtering for devenv, and I saw a lot of entries of fussionlog. I had enabled fussionlog for debugging purposes some weeks before and didn't think in disabling it. I just had to disable fussionlog and the solution opened faster.
You can open the Visual Studio in the Safe Mode, and then check your plugin and source control settings after opening the project.
Safe Mode means "Starts Visual Studio, loading only the default environment and services."
How :
devenv /SafeMode
Or according to your path
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" /SafeMode
source : https://msdn.microsoft.com/en-us/library/ms241278.aspx
In my case, the following worked without any of the intervening steps suggested:
Kill Visual Studio.
Start Visual Studio directly (i.e., not from the .sln file).
Then, from within Visual Studio, open the solution.
In my case this was all it took to make the problem solution load quite quickly, without the need for me to change any settings or delete any files.
fwiw, I realize this is a late entry, but I found that simply removing (deleting) my large number of breakpoints resolved the excessive load time and compile time.
This action reduced the size of the .suo file from 214MB to 977KB. Let VS handle the .suo file itself.
Compiling and loading now takes < 1 minute instead of 5-10 minutes for a solution with 35 projects. Visual Studio 2012 Pro, update 4.
None of the other answers worked for me. CI compile times were fine, but loading my solution in Visual Studio was taking almost two minutes. VS would then operate just fine until I closed and opened the solution the next time. Different versions of VS all showed the same problem and both safe mode and deleting the suo didn't help.
I ended up following the advice in http://geekswithblogs.net/akraus1/archive/2014/04/30/156156.aspx to use Windows Performance Recorder to instrument VS and find the problem. By looking in Windows Performance Analyzer under the "CPU Usage (Sampled)" section and adding the "Stack (Frame Tags)" column, I was able to dig into the usage of devenv.exe.
Turns out the hot path by count had Microsoft.VisualStudio.Platform.WindowManagement.ni.dll 23 calls down, and below that eventually Microsoft.VisualStudio.ServerExplorer.dll and Microsoft.VisualStudio.Data.Package.dll. That pointed me to look in Server Explorer in the UI and open the Data Connections tab. There I found hundreds of mistakenly added connections that came from the debug web.config's ConnectionString section. Removing those from web.config reduced the load of that individual project from 90+ seconds to almost instant.
I have a different cause for the slow loading of the projects.
My situation is utilizing Git and found that even switching branches was slower than it should be with project load.
Solution: Run Visual Studio as Administrator
Reason: Something with the Corporate laptop is not providing the needed Git tool access (it doesn't recognize that a git repository is in use).
I have not seen any issues with Git or my personal access to any of the project files or Git objects.
I tried the above, but it didn't solve my problem.
Here's how I got around this problem, hopefully it will work for some of you as well:
Open Visual Studio 2013 with no solution.
Create a new C# Console application and save it.
Close Visual Studio.
Reopen the Console solution created in step 2.
Close Visual Studio.
Reopen the solution that was previously hanging on the Preparing Solution dialogue. Mine opened right away, no more hanging.
Using Visual Studio 2015, I ended up creating a new solution, adding the existing projects.
Deleting the *.suo from gehho's answer helped in the past, but didn't help me in this case. There's also another .suo file in a hidden .vs folder at the root of the solution.
There are other answers here for Visual Studio 2015 Visual Studio 2015 is extremely slow
For my case it was due to TFS issue. It thinks that there are more than 5000 pending changes.
The fix is to force TFS to recheck. Go to Team Explorer -> Source Control Explorer and do "Get Latest" on the projects that have pending changes. For things that are already matching TFS, Visual Studio will actually not download anything to your PC. For things that are different with TFS, Visual Studio will let you know and ask you to reconcile the difference.
This is VS 2019 Professional.
In my case there were <import ...> entries in the project files that pointed to
paths no longer available making the loading of the solution hang indefinitely without any form of information give (Shame on Microsoft!).
I encountered this problem only recently (Mar 2021), using VS 2019. It literarily takes 30+ seconds to load the file (each).
It only effects the Layout files. I believe it could be to do with the links within the files. I have not had time to investigate them.
However, I am writing this to suggest that regardless of the cause of the problem, a simple solution is to right click on the file and open it with Notepad to get your work done.
I have a weird situation: Visual Studio 2010 will hang up indefinitely on me when opening certain websites. It prompts me for my credentials and loads up much of the project tree, and then just hangs at the "Preparing Solution..." dialog, which just then never goes away. In every case, the status bar of VS says that it is currently loading web.config.
It only happens on some websites, not all, but the websites that do fail, they all open without any problem in Visual Studio 2008. So it almost seems like 2010 is having some sort of problem parsing web.config files under certain circumstances (unless of course that web.config message was just the last file to load and it's actually crashing on the next step).
I've tried disabling all my add-ins and extensions, which did not help.
This turned out to be an extension which needed to be updated. In short, if VS says your extensions need updating, then update them. BEFORE trying to open a project, otherwise you may have problems.