Why does it take sooo long to load my solution in Visual Studio?
A

15

55

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!)

Ardeth answered 21/8, 2013 at 14:39 Comment(0)
A
80

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):

  1. Kill Visual Studio
  2. Open Visual Studio without loading a solution
  3. Disable AnkhSvn as Source Control plugin (Tools->Options->Source Control->Plug-in Selection->None)
  4. 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...
  5. Close Visual Studio
  6. 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.
  7. Restart Visual Studio
  8. Load the solution - it was much faster now!
  9. Close Visual Studio
  10. Open Visual Studio without loading a solution
  11. Re-enable AnkhSvn and the "Document Well"
  12. Restart Visual Studio
  13. 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. :)

Ardeth answered 21/8, 2013 at 14:39 Comment(10)
Thanks for sharing this. In my case, deleting suo file improved loading performance of the solution.Huntsville
Thanks I've been having so much trouble with this the last few days and there's tons of complaints about stuff like this but no other answers solved my problem.Movement
Step 6 fixed it for me - Delete the solution's *.suo file.Footstall
This is a useful blog post in my opinion: briannoyes.net/2008/05/10/…Oeflein
Step 6 fixed it for me too.Conscript
I did just step 3 to disable AnkhSvn plugin. That worked for me. It went from a half an hour to a minute.Twelvemonth
This greatly improved the start and stop debugging time as well.Curlicue
Just to chime in to confirm this also solved the same problem in Visual Studio Express 2010. We don't use any of the plugins mentioned in the solution, but just deleting the .suo and ipch helped. Thanks!Endospore
I have same problem in vs 2022 ! deleting suo file solved the problemSiegfried
It's March 2023. It looks like just deleting the .suo fixed it. Be aware that that file it is not in the same folder that the solution file (at least that was my case for my project). It was inside one of the folders inside .vs folder. i.imgur.com/ZpwFzqh.png Notes is the name of the only namespace I was working on.Dock
C
5

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.

Clawson answered 25/2, 2016 at 12:2 Comment(0)
I
4

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

Inexperience answered 17/5, 2016 at 14:27 Comment(0)
P
3

In my case, the following worked without any of the intervening steps suggested:

  1. Kill Visual Studio.
  2. Start Visual Studio directly (i.e., not from the .sln file).
  3. 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.

Playreader answered 29/10, 2017 at 19:19 Comment(1)
For me this worked remarkably well. It went from taking minutes when opening VS in conjunction with a solution to taking less than a minute to do all three steps.Tuddor
C
2

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.

Covet answered 13/4, 2015 at 15:38 Comment(0)
A
2

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.

Albertina answered 5/6, 2017 at 19:22 Comment(0)
N
1

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.

Niello answered 10/12, 2021 at 18:43 Comment(0)
D
0

Feel free to enumerate your case and solution, in this community wiki.

Case 1

Using this installation for VS22, working in a .NET MAUI project, I was able to make it work again after:

  1. Discarding some changes I made to some *.xaml and *.xaml.cs files, and
  2. After deleting the *.csproj.user

But my best guess, despite I had implemented before several possible solutions, is that step 2 made the fix. Comparing old and new files, led me to the conclusion that the a missing addition of ios-arm64 caused the problem (see files here). After this changes, the IDE work as usual.

Dock answered 21/8, 2013 at 14:39 Comment(1)
Honestly, even after implementing this "solution" I'm still on doubt it this was that fixed it. How can this problem be so obscured...?Dock
R
0

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:

  1. Open Visual Studio 2013 with no solution.
  2. Create a new C# Console application and save it.
  3. Close Visual Studio.
  4. Reopen the Console solution created in step 2.
  5. Close Visual Studio.
  6. Reopen the solution that was previously hanging on the Preparing Solution dialogue. Mine opened right away, no more hanging.
Rapturous answered 2/4, 2015 at 14:43 Comment(0)
D
0

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

Disfigure answered 14/8, 2018 at 18:43 Comment(0)
A
0

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.

Archicarp answered 5/6, 2021 at 1:20 Comment(0)
C
0

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

Clarion answered 21/2, 2023 at 9:47 Comment(0)
P
0

In VS2022, I unchecked the option "Solution Explorer Refresh refreshes source control status" before opening the solution. I checked it again because it doesn't happen for all solutions.

Photograph answered 8/5, 2023 at 12:20 Comment(0)
W
0

In my case, I just disabled the Anti virus and it loaded so quickly.

Wearable answered 6/9, 2023 at 4:23 Comment(0)
G
-1

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.

Gumwood answered 30/3, 2021 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.