views:

1415

answers:

8

I am working on an asp.net 3.5 project which has 55 projects in a solution. When opening the solution in visual studio 2008 it takes over a minute to open - about 1 second for each project. However, if I disconnect the network cable before opening the solution, it only takes about 15 seconds! Any ideas about what could be causing the slowdown?

+5  A: 

I had this happen to me back in the days when we were using Visual Source Safe.

Could be your source control plugin asking for updates if you have the solution under source control.

jvanderh
A: 

A few years ago I remember a colleague having some similar problem (with a lot smaller solution, and in VS2003). Can't remember the details, but I think it was related to the local ASPNET user account (or rather, that it did not exist). Not sure though...

As a side note: I usually find it more efficient to have perhaps around a handful of projects in each solution (usually one solution produces one or two assemblies used in production code), and then have a few Visual Studio instances running at the same time. 50+ projects in the same solutions feels like asking for problems.

Might be that you have other dependencies though, just wanted to share my thoughts.

Fredrik Mörk
A: 

which has 55 projects in a solution

WOW. I can't imagine what type of solution needs that many projects. The answer is probably that your source control provider needs to refresh the status of each of the items, all of which take time.

For edit-merge-commit style version control systems, such as subversion, this operation doesn't take place. Try temporarily removing source control from the entire solution to see if this is the culprit.

Ben Scheirman
A: 

If your solution is attached to source control, then it is trying to load up the symbols and verify which items you have checked out. So, if you have a slow connection, it is oftentimes faster to take the solution offline.

http://www.tmgirvin.com/2009/03/working-offline-with-visual-studio-2008-and-tfs.html

EDIT Another solution which I've seen used, create a _webTier.sln _database.sln _build.sln ( is your project name)

and each of those solutions is a self-sufficient part of the entire project, but that way if you are working on the webtier and you don't need the database project or the mobile project parts to load up, you can just open the webtier solution.

The build solution contains the entire package that needs to be built, and takes a very long time to load.

A: 

Thanks for the replies, but it's still a mystery.

We're using CVS for source control, but it's completely independent from visual studio, so I don't see how that could be the culprit.

Cutting down the number of projects would undoubtedly speed things up, but we don't have the time to reorganize things right now. Eventually, that will get done, I'm sure.

A: 

Can I answer a question with a question? What is the secret to getting VS to not just die with that many projects, let alone load in a phenomenally quick 60 seconds?

At about 10-12 projects the compile time on Visual Studio becomes unbearable, at about 5-8 projects Resharper will crash. The IDE is such a memory pig that even opening more projects by using multiple instances of VS usually isn't an option.

Anyhow, it's all about memory usage and the odd ball out project is probably doing it, e.g. the one with the most files.

MatthewMartin
Without the network connection, it loads in about 15 seconds. According to Process Explorer, the working set size for visual studio is about 300,000K after doing a build with a virtual size of 750,000K. So having 2GB of memory (at least) is very helpful.It's not one particular project that's causing the problem. I can watch the message at the bottom as it loads each project, and each one takes about the same amount of time.
Paul Hyman
+2  A: 

You should do some investigation, fire up Wireshark, start a capture on the interface in question and see what traffic is flowing over the wire.

Si
Thanks for the tip about Wireshark. I downloaded and ran it. Assuming I'm interpreting the results right, the only traffic I see due to visual studio is lots of DNS queries. I don't know what it's looking up, but I suppose slow responses from the nameserver could be causing the delays.
Paul Hyman
Any chance it's this problem? http://dotnetjunkies.com/Newsgroups/microsoft.public.vsnet.ide/2004/3/29/97325.aspx
Si
Sorry, that link didn't work (Page Cannot be found).
Paul Hyman
Sorry Paul, copied the wrong link...anyway the problem reported was the Most Recently Used (MRU) list in VS contained a link to a network resource which didn't exist any more.Description: http://weblogs.asp.net/achang/archive/2004/05/04/125645.aspxHow to clear:http://blogs.msdn.com/benko/archive/2009/01/05/how-to-clear-out-the-mru-list-in-vs-2008.aspx
Si
Thanks for the tip. Unfortunately, I deleted the entries from the registry and -- no difference. Guess I'm just going to have to keep unplugging the network cable before starting visual studio.
Paul Hyman
I think your first comment about DNS queries warrants further investigation, I'm not a network specialist but with a little work you should be able to track it down. Good luck!
Si
A: 

I had this problem on a development machine with no internet connection and it turned out that the problem was related to a setting in IE's internet options:

Control Panel -> Internet Options -> Advanced -> Security -> Check for publisher's certificate revocation

After making sure this was unchecked my solutions started loading quickly again.

Taylor Leese